home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TGCBOR20.ARJ / HEADER.COM / TEGLSYS.H
C/C++ Source or Header  |  1991-08-30  |  120KB  |  3,632 lines

  1. /*---------------------------------------------------------------------------*
  2.  |               TEGL Windows ToolKit II                 |
  3.  |          Copyright (C) 1990, TEGL Systems Corporation             |
  4.  |                All Rights Reserved.                 |
  5.  *---------------------------------------------------------------------------*/
  6. /*    teglcond.h
  7.  
  8.     Conditional defines and compatability defines
  9.  
  10.  
  11.     Copyright (c) TEGL Systems Corporation 1989,1990
  12.     All Rights Reserved.
  13. */
  14.  
  15.  
  16. #ifndef __TEGLCOND_H
  17. #define __TEGLCOND_H
  18.  
  19. #ifdef __WATCOMC__
  20. #include <stddef.h>
  21. #ifndef MSDOS
  22. #define MSDOS
  23. #endif
  24. #define QUICKC
  25. #define __STDTEGL__
  26. #endif
  27.  
  28. #ifdef __TSC__
  29. #define TURBOC
  30. #define __STDTEGL__
  31. #endif
  32.  
  33. #ifdef __STDTEGL__
  34. #define _TGdecl
  35. #else
  36. #define _TGdecl  cdecl
  37. #endif
  38.  
  39. #define __PASTEGL__
  40. #ifndef __PASTEGL__
  41. #define _TGType _TGdecl
  42. #else
  43. #define _TGType pascal
  44. #endif
  45.  
  46.  
  47. /* MSDOS is defined in Quick C and Microsoft C    */
  48. #ifdef MSDOS
  49. #define QUICKC
  50. #else
  51. #define TURBOC
  52. #endif
  53.  
  54. /* only define one of these for the compiler, only necessary if */
  55. /* the above does not recognize the compiler type. */
  56. /* #define TURBOC  */
  57. /* #define QUICKC */
  58.  
  59. #ifdef TURBOC
  60. #ifdef QUICKC
  61. #error Can only define one compiler.
  62. #endif
  63. #endif
  64.  
  65. #ifndef TURBOC
  66. #ifndef QUICKC
  67. #error No compiler defined.
  68. #endif
  69. #endif
  70.  
  71. /* #define TRACE */
  72. #ifdef TRACE
  73. #define trace(fmt,itm)     printf(fmt,itm); getch()
  74. #else
  75. #define trace(fmt,itm)
  76. #endif
  77.  
  78.  
  79. /* define to build the demonstrator version of the library */
  80.  
  81. #define TEGLDEMO
  82.  
  83.  
  84. /* define if the virtual memory manager is NOT to be used  */
  85.  
  86. /* #define NOVIRT */
  87.  
  88. /* define if the graphics libraries from TURBO C or QUICK C are */
  89. /* not to be used. */
  90.  
  91. #define NOGR
  92.  
  93. /* common defines */
  94.  
  95. #ifdef __cplusplus
  96. extern "C" {
  97. #endif
  98. extern void cdecl resetkeyboard(void);
  99. #ifdef __cplusplus
  100. }
  101. #endif
  102.  
  103.  
  104. #ifndef TGMK_FP
  105. #define TGMK_FP(seg,ofs)  ((void far *) \
  106.                (((unsigned long)(seg) << 16) | (unsigned)(ofs)))
  107. #endif
  108.  
  109. #ifndef NULL
  110. #if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
  111. #define NULL    0
  112. #else
  113. #define NULL    0L
  114. #endif
  115. #endif
  116.  
  117.  
  118. #include <stdlib.h>
  119. #include <stdio.h>
  120. #include <string.h>
  121. #include <dos.h>
  122.  
  123. #ifdef TURBOC
  124. #include <dir.h>
  125. #include <alloc.h>
  126. #include <sys\stat.h>
  127.  
  128. #if defined(__TSC__)
  129. #define OS_MAJOR  (__TSC__ & 0xff)
  130. #else
  131. #define OS_MAJOR  (_version & 0xff)
  132. #endif
  133. #endif
  134.  
  135. #ifdef QUICKC
  136.  
  137. #include <malloc.h>
  138. #include <direct.h>
  139. #include <sys\types.h>
  140. #include <sys\stat.h>
  141.  
  142. #define random( max ) ((rand() % (int)((max) - (0))) + (0) + 1)
  143. #define poke(a,b,c)  (*((int far*) TGMK_FP((a),(b))) = (int) (c))
  144. #define peekb( a,b )( *( (char far* ) TGMK_FP( (a ),( b )) ))
  145. #define pokeb( a,b,c )( *( (char far* ) TGMK_FP( (a ),( b )) ) =( char )( c ))
  146.  
  147. extern void sound(unsigned mhz);
  148. extern void nosound(void);
  149. extern void delay(unsigned delayms);
  150.  
  151. /* TURBO C's and QUICK C's dos.h are largely compatible */
  152. /* just a few name changes are required.  */
  153.  
  154. #define time  dostime_t
  155. #define gettime  _dos_gettime
  156. #define ti_sec     second
  157.  
  158. #define dfree  diskfree_t
  159. #define df_avail  avail_clusters
  160. #define df_total  total_clusters
  161. #define df_bsec   bytes_per_sector
  162. #define df_sclus  sectors_per_cluster
  163. #define findnext  _dos_findnext
  164.  
  165. #define WILDCARDS 0x01
  166. #define EXTENSION 0x02
  167. #define FILENAME  0x04
  168. #define DIRECTORY 0x08
  169. #define DRIVE      0x10
  170.  
  171. #define MAXPATH   _MAX_PATH
  172. #define MAXDRIVE  _MAX_DRIVE
  173. #define MAXDIR      _MAX_DIR
  174. #define MAXFILE   _MAX_FNAME
  175. #define MAXEXT      _MAX_EXT
  176.  
  177. #define FA_RDONLY _A_RDONLY
  178. #define FA_HIDDEN _A_HIDDEN
  179. #define FA_SYSTEM _A_SYSTEM
  180. #define FA_ARCH   _A_ARCH
  181. #define FA_LABEL    0x08        /* Volume label */
  182. #define FA_DIREC    0x10        /* Directory */
  183.  
  184. #define fnsplit   _splitpath
  185. #define fnmerge   _makepath
  186.  
  187. #define findfirst(a,b,c) _dos_findfirst(a,c,b)
  188. #define ffblk find_t
  189.  
  190. #define OS_MAJOR  _osmajor
  191.  
  192. #define farmalloc(x)    ((void far *)halloc(x,1))
  193. #define farfree(x)    hfree((void huge *)x)
  194.  
  195. #define stpcpy(d,s)    (strcpy (d, s), d + strlen (s))
  196.  
  197. #endif
  198.  
  199. #ifndef FALSE
  200. #define FALSE 0
  201. #define TRUE  1
  202. #endif
  203.  
  204. /* if its QuickC and NoGr has not been specifically defined by now */
  205. /* then use the graphics routines provided with the compiler. */
  206.  
  207. #ifdef QUICKC
  208. #ifndef NOGR
  209. #define MSGRAPH
  210. #endif
  211. #endif
  212.  
  213. /* map the Borland graph drivers to TEGL just in case */
  214. /* The TEGL graphic drivers are defined in FASTGRPH */
  215.  
  216. #define CGA_driver    GRCGABW_driver
  217. #define EGAVGA_driver    GREVGA16_driver
  218. #define IBM8514_driver    GREVGA16_driver
  219. #define Herc_driver    GRHERCBW_driver
  220. #define ATT_driver    GREVGA16_driver
  221. #define PC3270_driver    GREVGA16_driver
  222.  
  223.  
  224.  
  225. #endif
  226. /*    errorlog.h
  227.  
  228.     Standard Error for delayed message output
  229.  
  230.     Copyright (c) TEGL Systems Corporation 1989,1990,1991
  231.     All Rights Reserved.
  232. */
  233.  
  234. #ifndef __ERRORLOG_H
  235. #define __ERRORLOG_H
  236.  
  237. #ifdef __STDTEGL__
  238. #define _TGdecl
  239. #else
  240. #define _TGdecl  cdecl
  241. #endif
  242.  
  243. #ifndef __PASTEGL__
  244. #define _TGType _TGdecl
  245. #else
  246. #define _TGType pascal
  247. #endif
  248.  
  249. #ifdef __cplusplus
  250. extern "C" {
  251. #endif
  252.  
  253. void _TGdecl logmessage(char * msg);
  254. void _TGdecl aborterror(char * msg, int errorcode);
  255. void _TGdecl abortexit(char * msg);
  256. void _TGdecl showloggedmsg(void);
  257. void _TGdecl clearlog(void);
  258.  
  259. #ifdef __cplusplus
  260. }
  261. #endif
  262. #endif
  263. /*    videochk.h
  264.  
  265.     Defines structs and functions for Autodetecting Graphic Drivers
  266.  
  267.     Copyright (c) TEGL Systems Corporation 1989,1990
  268.     All Rights Reserved.
  269. */
  270.  
  271. #ifndef __VIDEOCHK_H
  272. #define __VIDEOCHK_H
  273.  
  274. #ifdef __STDTEGL__
  275. #define _TGdecl
  276. #else
  277. #define _TGdecl  cdecl
  278. #endif
  279.  
  280. #ifndef __PASTEGL__
  281. #define _TGType _TGdecl
  282. #else
  283. #define _TGType pascal
  284. #endif
  285.  
  286. typedef struct vidid {
  287.      unsigned char    video0type;
  288.      unsigned char    display0type;
  289.      unsigned char    video1type;
  290.      unsigned char    display1type;
  291. } vidid;
  292.  
  293. #define TG_MDA           0x01
  294. #define TG_CGA           0x02
  295. #define TG_EGA           0x03
  296. #define TG_MCGA        0x04
  297. #define TG_VGA           0x05
  298. #define TG_SVGA        0x06
  299. #define TG_SVGA256       0x07
  300. #define TG_VGA256       0x08
  301. #define TG_HGC           0x80
  302. #define TG_HGCPLUS       0x81
  303. #define TG_INCOLOR       0x82
  304.  
  305. #define TG_MDADISPLAY       0x01
  306. #define TG_CGADISPLAY       0x02
  307. #define TG_EGACOLORDISPLAY 0x03
  308. #define TG_PS2MONODISPLAY  0x04
  309. #define TG_PS2COLORDISPLAY 0x05
  310.  
  311. extern char videochoicescga640x200x2;
  312. extern char videochoicesega640x350x16;
  313. extern char videochoicesvga640x480x16;
  314. extern char videochoicesherc720x348x2;
  315.  
  316. #ifdef __cplusplus
  317. extern "C" {
  318. #endif
  319.  
  320. void     _TGType videoid(vidid far * v);
  321. void     _TGdecl setvideochoices(unsigned v, char accept);
  322. char    *_TGdecl videomodestring(char vtype, char dtype);
  323. char    *_TGdecl videoautodetect(void);
  324. char    *_TGdecl returnvideotype(void);
  325.  
  326. #ifdef __cplusplus
  327. }
  328. #endif
  329. #endif
  330. /*    fastgrph.h
  331.  
  332.     Defines structs and functions for the TEGL Graphic Drivers
  333.  
  334.     Copyright (c) TEGL Systems Corporation 1989,1990
  335.     All Rights Reserved.
  336. */
  337.  
  338. #ifndef __FASTGRPH_H
  339. #define __FASTGRPH_H
  340.  
  341. #ifdef __STDTEGL__
  342. #define _TGdecl
  343. #else
  344. #define _TGdecl  cdecl
  345. #endif
  346.  
  347. #ifndef __PASTEGL__
  348. #define _TGType _TGdecl
  349. #else
  350. #define _TGType pascal
  351. #endif
  352.  
  353. typedef void (far *vmode)(void);
  354. typedef unsigned masktype[2][16];
  355. #define maskptr masktype *
  356.  
  357. typedef void (far *fontptr)(void);
  358.  
  359. /* typedef struct fontinfo *fontptr; */
  360. typedef struct fontinfo {
  361.     unsigned fontsignature;
  362.     unsigned char fontheight;
  363.     unsigned char fontwidth;
  364.     unsigned char fontasciistart;
  365.     unsigned char fontasciiend;
  366.     unsigned char fonttop;
  367.     unsigned char fontbase;
  368.     unsigned char fontbottom;
  369.     unsigned char fontbytewidth;
  370. } fontinfo;
  371.  
  372. typedef struct videoinforec *videoinfoptr;
  373. typedef struct videoinforec {
  374.     char modename[22];        /* Mode String Name */
  375.     int modenumber;        /* Mode Number */
  376.     unsigned maxx;        /* Device Full Resolution in X */
  377.     unsigned maxy;        /* Device Full Resolution in Y */
  378.     unsigned stdchrwidth;    /* Standard char size X */
  379.     unsigned stdchrheight;    /* Standard char size Y */
  380.     unsigned maxcolor;        /* Number of colors */
  381.     unsigned maxpages;        /* Number of pages */
  382.     unsigned maxpalette;    /* Number of palettes */
  383.     unsigned activepage;    /* buffer offset for 2 page */
  384.     unsigned screenseg;     /* Screen Segment */
  385.     unsigned bytesperline;    /* bytes per line */
  386.     unsigned aspectx;        /* aspect ratio x * 1000 */
  387.     unsigned aspecty;        /* aspect ratio y * 1000 */
  388.     char *driveraddr;        /* video driver start address */
  389.     char *drivernameptr;    /* video driver name char * */
  390.     char *driverjumptable;    /* video driver Jump Table */
  391.     void *graphbufferptr;    /* Graphic Work Buffer */
  392.     unsigned graphbuffersize;    /* Graphic Size Buffer */
  393.     unsigned rmwbits;        /* Read/Write modes */
  394.     unsigned char transparency; /* transpanrancy on-$00/off-$ff */
  395.     unsigned char jagged;    /* jagged characters on-$01/off-$00 */
  396.     fontptr  fonttable;     /* char * to font table */
  397.     unsigned char egapaletteflag;    /* allow EGA pallete set */
  398.     unsigned char rgbpaletteflag;    /* allow VGA pallete set */
  399.     unsigned char proportionalfont;    /* proportional font switch */
  400.     unsigned teglfillmask;    /* fillmask for lines */
  401.     unsigned wminx;        /* viewport - minx */
  402.     unsigned wminy;        /* viewport - miny */
  403.     unsigned wmaxx;        /* viewport - maxx */
  404.     unsigned wmaxy;        /* viewport - maxy */
  405.     unsigned char clipped;    /* viewport - clipping on/off */
  406.     unsigned mousecolor;    /* Mouse color */
  407.     unsigned mousehotspot_xofs; /* Mouse hotspot */
  408.     unsigned mousehotspot_yofs; /* Mouse hotspot */
  409.     maskptr mousemask;        /* Mouse Cursor Mask */
  410.     videoinfoptr nextmodeptr;    /* Next VideoMode */
  411. } videoinforec;
  412.  
  413. typedef struct driverfiletable *driverfileptr;
  414. typedef struct driverfiletable {
  415.     driverfileptr nextdrvfile;
  416.     char modename[21];
  417.     char filename[81];
  418. } driverfiletable;
  419.  
  420. typedef struct bgigdgmrec *bgigdgmptr;
  421. typedef struct bgigdgmrec {
  422.     bgigdgmptr nextbgiptr;
  423.     char modename[21];
  424.     int gd;
  425.     int gm;
  426. } bgigdgmrec;
  427.  
  428. typedef struct bgitgirec *bgitgidrv;
  429. typedef struct bgitgirec {
  430.     bgitgidrv nextbgitgi;
  431.     char tgidriver[16];
  432.     int graphdriver;
  433. } bgitgirec;
  434.  
  435. #define FGNORM    0x00
  436. #define FGAND    0x08
  437. #define FGOR    0x10
  438. #define FGXOR    0x18
  439. #define FGNOT    0x80
  440.  
  441. #define grok              0
  442. #define grnoinitgraph         -1
  443. #define grnotdetected         -2
  444. #define grfilenotfound         -3
  445. #define grinvaliddriver      -4
  446. #define grnoloadmem         -5
  447. #define grnoscanmem         -6
  448. #define grnofloodmem         -7
  449. #define grfontnotfound         -8
  450. #define grnofontmem         -9
  451. #define grinvalidmode        -10
  452. #define grerror         -11
  453. #define grioerror        -12
  454. #define grinvalidfont        -13
  455. #define grinvalidfontnum    -14
  456.  
  457. #ifdef QUICKC
  458. typedef char         *(_TGType far* teglgrfunc00)(void);
  459. typedef unsigned      (_TGType far* teglgrfunc01)(unsigned,unsigned);
  460. typedef unsigned      (_TGType far* teglgrfunc02)(unsigned,unsigned,void*);
  461. typedef unsigned long (_TGType far* teglgrfunc03)(unsigned,unsigned,unsigned,unsigned);
  462. typedef unsigned      (_TGType far* teglgrfunc04)(unsigned);
  463. typedef unsigned      (_TGType far* teglgrfunc05)(unsigned,unsigned,unsigned,int);
  464.  
  465. typedef void (_TGType far * teglgrproc00)(void*);
  466. typedef void (_TGType far * teglgrproc01)(unsigned,unsigned,unsigned,unsigned,unsigned);
  467. typedef void (_TGType far * teglgrproc02)(unsigned,unsigned,unsigned);
  468. typedef void (_TGType far * teglgrproc03)(unsigned,unsigned,void*,unsigned);
  469. typedef void (_TGType far * teglgrproc04)(unsigned,unsigned,unsigned,unsigned,void*);
  470. typedef void (_TGType far * teglgrproc05)(unsigned,unsigned,unsigned,unsigned,void*,void*);
  471. typedef void (_TGType far * teglgrproc06)(unsigned,unsigned,void*,void*);
  472. typedef void (_TGType far * teglgrproc07)(unsigned,unsigned,unsigned,unsigned,unsigned);
  473. typedef void (_TGType far * teglgrproc08)(void);
  474. typedef void (_TGType far * teglgrproc09)(unsigned,unsigned);
  475. typedef void (_TGType far * teglgrproc10)(unsigned,unsigned,unsigned,unsigned,unsigned,unsigned,int,int,void*,void*);
  476. typedef void (_TGType far * teglgrproc11)(unsigned);
  477. #else
  478. #ifdef __TSC__
  479. typedef char         *(_TGType far* teglgrfunc00)(void);
  480. typedef unsigned      (_TGType far* teglgrfunc01)(unsigned,unsigned);
  481. typedef unsigned      (_TGType far* teglgrfunc02)(unsigned,unsigned,void*);
  482. typedef unsigned long (_TGType far* teglgrfunc03)(unsigned,unsigned,unsigned,unsigned);
  483. typedef unsigned      (_TGType far* teglgrfunc04)(unsigned);
  484. typedef unsigned      (_TGType far* teglgrfunc05)(unsigned,unsigned,unsigned,int);
  485.  
  486. typedef void (_TGType far * teglgrproc00)(void*);
  487. typedef void (_TGType far * teglgrproc01)(unsigned,unsigned,unsigned,unsigned,unsigned);
  488. typedef void (_TGType far * teglgrproc02)(unsigned,unsigned,unsigned);
  489. typedef void (_TGType far * teglgrproc03)(unsigned,unsigned,void*,unsigned);
  490. typedef void (_TGType far * teglgrproc04)(unsigned,unsigned,unsigned,unsigned,void*);
  491. typedef void (_TGType far * teglgrproc05)(unsigned,unsigned,unsigned,unsigned,void*,void*);
  492. typedef void (_TGType far * teglgrproc06)(unsigned,unsigned,void*,void*);
  493. typedef void (_TGType far * teglgrproc07)(unsigned,unsigned,unsigned,unsigned,unsigned);
  494. typedef void (_TGType far * teglgrproc08)(void);
  495. typedef void (_TGType far * teglgrproc09)(unsigned,unsigned);
  496. typedef void (_TGType far * teglgrproc10)(unsigned,unsigned,unsigned,unsigned,unsigned,unsigned,int,int,void*,void*);
  497. typedef void (_TGType far * teglgrproc11)(unsigned);
  498. #else
  499. typedef char         *_TGType(far* teglgrfunc00)(void);
  500. typedef unsigned      _TGType(far* teglgrfunc01)(unsigned,unsigned);
  501. typedef unsigned      _TGType(far* teglgrfunc02)(unsigned,unsigned,void*);
  502. typedef unsigned long _TGType(far* teglgrfunc03)(unsigned,unsigned,unsigned,unsigned);
  503. typedef unsigned      _TGType(far* teglgrfunc04)(unsigned);
  504. typedef unsigned      _TGType(far* teglgrfunc05)(unsigned,unsigned,unsigned,int);
  505.  
  506. typedef void _TGType(far * teglgrproc00)(void*);
  507. typedef void _TGType(far * teglgrproc01)(unsigned,unsigned,unsigned,unsigned,unsigned);
  508. typedef void _TGType(far * teglgrproc02)(unsigned,unsigned,unsigned);
  509. typedef void _TGType(far * teglgrproc03)(unsigned,unsigned,void*,unsigned);
  510. typedef void _TGType(far * teglgrproc04)(unsigned,unsigned,unsigned,unsigned,void*);
  511. typedef void _TGType(far * teglgrproc05)(unsigned,unsigned,unsigned,unsigned,void*,void*);
  512. typedef void _TGType(far * teglgrproc06)(unsigned,unsigned,void*,void*);
  513. typedef void _TGType(far * teglgrproc07)(unsigned,unsigned,unsigned,unsigned,unsigned);
  514. typedef void _TGType(far * teglgrproc08)(void);
  515. typedef void _TGType(far * teglgrproc09)(unsigned,unsigned);
  516. typedef void _TGType(far * teglgrproc10)(unsigned,unsigned,unsigned,unsigned,unsigned,unsigned,int,int,void*,void*);
  517. typedef void _TGType(far * teglgrproc11)(unsigned);
  518. #endif
  519. #endif
  520.  
  521. extern videoinfoptr _TGType activeteglmode;
  522. extern videoinfoptr _TGType drvinfotable;
  523. extern void * graphscanbuffer;
  524. extern unsigned graphbuffersize;
  525.  
  526. extern bgigdgmptr drvbgitable;
  527.  
  528. #ifdef NOGR
  529. extern int lastmode__;
  530. extern int lastpage__;
  531. #endif
  532.  
  533. #ifdef __cplusplus
  534. extern "C" {
  535. #endif
  536.  
  537. extern    teglgrfunc00 _TGType getvideotable;
  538. extern    teglgrfunc01 _TGType getpixs;
  539. extern    teglgrfunc02 _TGType extractpixs;
  540. extern    teglgrfunc03 _TGType bigimagesize;
  541. extern    teglgrfunc04 _TGType initvideomode;
  542. extern    teglgrfunc05 _TGType scanborder;
  543.  
  544. extern    teglgrproc00 _TGType setvideotable;
  545. extern    teglgrproc00 _TGType setxlattable;
  546. extern    teglgrproc01 _TGType fastline;
  547. extern    teglgrproc02 _TGType putpixs;
  548. extern    teglgrproc03 _TGType putbiti;
  549. extern    teglgrproc04 _TGType getbiti;
  550. extern    teglgrproc05 _TGType extractimg;
  551. extern    teglgrproc06 _TGType overlayimg;
  552. extern    teglgrproc07 _TGType teglwrtchar;
  553. extern    teglgrproc08 _TGType mcursoroff;
  554. extern    teglgrproc09 _TGType mcursoron;
  555. extern    teglgrproc09 _TGType msetpos;
  556. extern    teglgrproc10 _TGType movevideopixels;
  557. extern    teglgrproc11 _TGType setteglvpage;
  558. extern    teglgrproc11 _TGType setteglapage;
  559.  
  560. extern int         _TGType attachtgidriver(char *  driver);
  561. extern int         _TGType registertgi(void (*driver)(void));
  562. extern void         _TGType putpict(unsigned x,unsigned y,char * buf,unsigned n);
  563. extern void         _TGType pictsize(unsigned * w,unsigned * h,char * buf);
  564. extern void         _TGType swapbytes(char * buff1,char * buff2,unsigned long bytestoswap);
  565. extern unsigned      _TGType teglcharwidth(unsigned c);
  566. extern unsigned      _TGType teglcharheight(void);
  567.  
  568. void          _TGdecl settransparency(unsigned char onoff);
  569. int          _TGdecl registertgidriver(void (*driver)(void));
  570. void          _TGdecl outtgtextxy(int x,int y,int color,int bkcolor,char * mystr,...);
  571. unsigned      _TGdecl tegltextwidth(char *mystr,...);
  572. int          _TGdecl teglcharbase(void);
  573. int          _TGdecl teglchartop(void);
  574. int          _TGdecl teglcharstart(void);
  575. int          _TGdecl teglcharbottom(void);
  576. int          _TGdecl teglcharrange(void);
  577. int          _TGdecl teglcharmaxwidth(void);
  578. void          _TGdecl setteglfont(fontptr p);
  579. fontptr       _TGdecl getteglfont(void);
  580. void          _TGdecl setproportional(unsigned char onoff);
  581. unsigned char _TGdecl getproportional(void);
  582. void          _TGdecl xorcornerbox(int x,int y,int x1,int y1,int color);
  583. void          _TGdecl xorbox(int x1,int y1,int x2,int y2,int color);
  584. void          _TGdecl fastrect(int x1,int y1,int x2,int y2,int c);
  585. void          _TGdecl fastbar(int x1,int y1,int x2,int y2,int c);
  586. int          _TGdecl setgraphicmode(char *modename,char far *pathtodriver);
  587. void          _TGdecl adddriverfilename(char * filename,char * modename);
  588. bgigdgmptr    _TGdecl findbgitomodename(int gd,int gm);
  589. bgigdgmptr    _TGdecl findmodenametobgi(char * modename);
  590. void          _TGdecl adddriverbgimodes(char * modename,int gd,int gm);
  591. bgitgidrv     _TGdecl findtgigraphdriver(char * tegldrivername);
  592. void          _TGdecl addtgigraphdriver(char * tegldrivername,int gd);
  593. void          _TGdecl allocatescanbuffer(unsigned bufsize);
  594. void          _TGdecl fastscrolldown(int x1,int y1,int x2,int y2,int pixlines);
  595. void          _TGdecl fastscrollup(int x1,int y1,int x2,int y2,int pixlines);
  596. void          _TGdecl fastscrollright(int x1,int y1,int x2,int y2,int pixlines);
  597. void          _TGdecl fastscrollleft(int x1,int y1,int x2,int y2,int pixlines);
  598. unsigned      _TGdecl getrmwbits(void);
  599. void          _TGdecl setrmwbits(unsigned rmwb);
  600. unsigned char _TGdecl overlaparea(unsigned ax,unsigned ay,unsigned ax1,unsigned ay1,
  601.                unsigned bx,unsigned by,unsigned bx1,unsigned by1,
  602.                unsigned * cx,unsigned * cy,unsigned * cx1,unsigned * cy1);
  603.  
  604. void          _TGdecl resetlastvideomode(int tmode, int tpage);
  605.  
  606.  
  607. /* !!         These "functions" are NOT user-callable          !! */
  608. /* !! They are there just so you can link in graphics drivers !! */
  609.  
  610. #ifdef __TSC__
  611. void   GREVGA16_driver(void);
  612. void   GRHERCBW_driver(void);
  613. void   GRCGABW_driver(void);
  614. void   GRVGA256_driver(void);
  615. #else
  616. void   cdecl GREVGA16_driver(void);
  617. void   cdecl GRHERCBW_driver(void);
  618. void   cdecl GRCGABW_driver(void);
  619. void   cdecl GRVGA256_driver(void);
  620. #endif
  621.  
  622. #ifdef __cplusplus
  623. }
  624. #endif
  625. #endif
  626. /*    tgraph.h
  627.  
  628.     Definitions for TEGL's Graphics Package.
  629.  
  630.     Copyright (c) TEGL Systems Corporation 1989,1990,1991
  631.     All Rights Reserved.
  632. */
  633.  
  634. #ifndef __TGRAPH_H
  635. #define __TGRAPH_H
  636.  
  637. #ifdef __STDTEGL__
  638. #define _TGdecl
  639. #else
  640. #define _TGdecl  cdecl
  641. #endif
  642.  
  643. #ifndef __PASTEGL__
  644. #define _TGType _TGdecl
  645. #else
  646. #define _TGType pascal
  647. #endif
  648.  
  649. #ifndef __FASTGRPH_H
  650. #include <FASTGRPH.H>
  651. #endif
  652.  
  653. enum graphics_errors {        /* graphresult error return codes */
  654.     grOk           =   0,
  655.     grNoInitGraph       =  -1,
  656.     grNotDetected       =  -2,
  657.     grFileNotFound       =  -3,
  658.     grInvalidDriver    =  -4,
  659.     grNoLoadMem       =  -5,
  660.     grNoScanMem       =  -6,
  661.     grNoFloodMem       =  -7,
  662.     grFontNotFound       =  -8,
  663.     grNoFontMem       =  -9,
  664.     grInvalidMode       = -10,
  665.     grError        = -11,   /* generic error */
  666.     grIOerror       = -12,
  667.     grInvalidFont       = -13,
  668.     grInvalidFontNum   = -14,
  669.     grInvalidVersion   = -18
  670. };
  671.  
  672. enum graphics_drivers {     /* define graphics drivers */
  673.     DETECT,         /* requests autodetection */
  674.     CGA, MCGA, EGA, EGA64, EGAMONO, IBM8514,    /* 1 - 6 */
  675.     HERCMONO, ATT400, VGA, PC3270,            /* 7 - 10 */
  676.     CURRENT_DRIVER = -1
  677. };
  678.  
  679. enum graphics_modes {        /* graphics modes for each driver */
  680.     CGAC0      = 0,  /* 320x200 palette 0; 1 page    */
  681.     CGAC1      = 1,  /* 320x200 palette 1; 1 page    */
  682.     CGAC2      = 2,  /* 320x200 palette 2: 1 page    */
  683.     CGAC3      = 3,  /* 320x200 palette 3; 1 page    */
  684.     CGAHI      = 4,  /* 640x200 1 page            */
  685.     MCGAC0     = 0,  /* 320x200 palette 0; 1 page    */
  686.     MCGAC1     = 1,  /* 320x200 palette 1; 1 page    */
  687.     MCGAC2     = 2,  /* 320x200 palette 2; 1 page    */
  688.     MCGAC3     = 3,  /* 320x200 palette 3; 1 page    */
  689.     MCGAMED    = 4,  /* 640x200 1 page            */
  690.     MCGAHI     = 5,  /* 640x480 1 page            */
  691.     EGALO      = 0,  /* 640x200 16 color 4 pages    */
  692.     EGAHI      = 1,  /* 640x350 16 color 2 pages    */
  693.     EGA64LO    = 0,  /* 640x200 16 color 1 page     */
  694.     EGA64HI    = 1,  /* 640x350 4 color  1 page     */
  695.     EGAMONOHI  = 0,  /* 640x350 64K on card, 1 page - 256K on card, 4 pages */
  696.     HERCMONOHI = 0,  /* 720x348 2 pages         */
  697.     ATT400C0   = 0,  /* 320x200 palette 0; 1 page    */
  698.     ATT400C1   = 1,  /* 320x200 palette 1; 1 page    */
  699.     ATT400C2   = 2,  /* 320x200 palette 2; 1 page    */
  700.     ATT400C3   = 3,  /* 320x200 palette 3; 1 page    */
  701.     ATT400MED  = 4,  /* 640x200 1 page            */
  702.     ATT400HI   = 5,  /* 640x400 1 page            */
  703.     VGALO      = 0,  /* 640x200 16 color 4 pages    */
  704.     VGAMED     = 1,  /* 640x350 16 color 2 pages    */
  705.     VGAHI      = 2,  /* 640x480 16 color 1 page     */
  706.     PC3270HI   = 0,  /* 720x350 1 page            */
  707.     IBM8514LO  = 0,  /* 640x480 256 colors        */
  708.     IBM8514HI  = 1   /*1024x768 256 colors        */
  709. };
  710.  
  711. /* Colors for setpalette and setallpalette */
  712.  
  713. #ifndef __COLORS
  714. #define __COLORS
  715.  
  716. enum COLORS {
  717.     BLACK,            /* dark colors */
  718.     BLUE,
  719.     GREEN,
  720.     CYAN,
  721.     RED,
  722.     MAGENTA,
  723.     BROWN,
  724.     LIGHTGRAY,
  725.     DARKGRAY,            /* light colors */
  726.     LIGHTBLUE,
  727.     LIGHTGREEN,
  728.     LIGHTCYAN,
  729.     LIGHTRED,
  730.     LIGHTMAGENTA,
  731.     YELLOW,
  732.     WHITE
  733. };
  734. #endif
  735.  
  736. enum CGA_COLORS {
  737.     CGA_LIGHTGREEN     = 1,        /* Palette C0 Color Names    */
  738.     CGA_LIGHTRED       = 2,
  739.     CGA_YELLOW           = 3,
  740.  
  741.     CGA_LIGHTCYAN      = 1,        /* Palette C1 Color Names    */
  742.     CGA_LIGHTMAGENTA   = 2,
  743.     CGA_WHITE           = 3,
  744.  
  745.     CGA_GREEN           = 1,        /* Palette C2 Color Names    */
  746.     CGA_RED           = 2,
  747.     CGA_BROWN           = 3,
  748.  
  749.     CGA_CYAN           = 1,        /* Palette C3 Color Names    */
  750.     CGA_MAGENTA        = 2,
  751.     CGA_LIGHTGRAY      = 3
  752. };
  753.  
  754.  
  755. enum EGA_COLORS {
  756.     EGA_BLACK         =  0,        /* dark colors */
  757.     EGA_BLUE         =  1,
  758.     EGA_GREEN         =  2,
  759.     EGA_CYAN         =  3,
  760.     EGA_RED         =  4,
  761.     EGA_MAGENTA      =  5,
  762.     EGA_BROWN         =  20,
  763.     EGA_LIGHTGRAY     =  7,
  764.     EGA_DARKGRAY     =  56,     /* light colors */
  765.     EGA_LIGHTBLUE     =  57,
  766.     EGA_LIGHTGREEN     =  58,
  767.     EGA_LIGHTCYAN     =  59,
  768.     EGA_LIGHTRED     =  60,
  769.     EGA_LIGHTMAGENTA     =  61,
  770.     EGA_YELLOW         =  62,
  771.     EGA_WHITE         =  63
  772. };
  773.  
  774. enum line_styles {        /* Line styles for get/setlinestyle */
  775.     SOLID_LINE   = 0,
  776.     DOTTED_LINE  = 1,
  777.     CENTER_LINE  = 2,
  778.     DASHED_LINE  = 3,
  779.     USERBIT_LINE = 4    /* User defined line style */
  780. };
  781.  
  782. enum line_widths {        /* Line widths for get/setlinestyle */
  783.     NORM_WIDTH  = 1,
  784.     THICK_WIDTH = 3
  785. };
  786.  
  787. enum font_names {
  788.     DEFAULT_FONT    = 0,    /* 8x8 bit mapped font */
  789.     TRIPLEX_FONT    = 1,    /* "Stroked" fonts */
  790.     SMALL_FONT    = 2,
  791.     SANS_SERIF_FONT = 3,
  792.     GOTHIC_FONT    = 4
  793. };
  794.  
  795. #define HORIZ_DIR    0    /* left to right */
  796. #define VERT_DIR    1    /* bottom to top */
  797.  
  798. #define USER_CHAR_SIZE    0    /* user-defined char size */
  799.  
  800. enum fill_patterns {        /* Fill patterns for get/setfillstyle */
  801.     EMPTY_FILL,        /* fills area in background color */
  802.     SOLID_FILL,        /* fills area in solid fill color */
  803.     LINE_FILL,        /* --- fill */
  804.     LTSLASH_FILL,        /* /// fill */
  805.     SLASH_FILL,        /* /// fill with thick lines */
  806.     BKSLASH_FILL,        /* \\\ fill with thick lines */
  807.     LTBKSLASH_FILL,     /* \\\ fill */
  808.     HATCH_FILL,        /* light hatch fill */
  809.     XHATCH_FILL,        /* heavy cross hatch fill */
  810.     INTERLEAVE_FILL,    /* interleaving line fill */
  811.     WIDE_DOT_FILL,        /* Widely spaced dot fill */
  812.     CLOSE_DOT_FILL,     /* Closely spaced dot fill */
  813.     USER_FILL        /* user defined fill */
  814. };
  815.  
  816. enum putimage_ops {        /* BitBlt operators for putimage */
  817.     COPY_PUT,        /* MOV */
  818.     XOR_PUT,        /* XOR */
  819.     OR_PUT,         /* OR  */
  820.     AND_PUT,        /* AND */
  821.     NOT_PUT         /* NOT */
  822. };
  823.  
  824. enum text_just {        /* Horizontal and vertical justification
  825.                    for settextjustify */
  826.     LEFT_TEXT    = 0,
  827.     CENTER_TEXT    = 1,
  828.     RIGHT_TEXT    = 2,
  829.  
  830.     BOTTOM_TEXT    = 0,
  831.      /* CENTER_TEXT    = 1,  already defined above */
  832.     TOP_TEXT    = 2
  833. };
  834.  
  835.  
  836. #define MAXCOLORS 15
  837.  
  838. struct palettetype {
  839.     unsigned char size;
  840.     signed char colors[MAXCOLORS+1];
  841. };
  842.  
  843. struct linesettingstype {
  844.     int linestyle;
  845.     unsigned upattern;
  846.     int thickness;
  847. };
  848.  
  849. struct textsettingstype {
  850.     int font;
  851.     int direction;
  852.     int charsize;
  853.     int horiz;
  854.     int vert;
  855. };
  856.  
  857. struct fillsettingstype {
  858.     int pattern;
  859.     int color;
  860. };
  861.  
  862. struct pointtype {
  863.     int x, y;
  864. };
  865.  
  866. struct viewporttype {
  867.     int left, top, right, bottom;
  868.     int clip;
  869. };
  870.  
  871. struct arccoordstype {
  872.     int x, y;
  873.     int xstart, ystart, xend, yend;
  874. };
  875.  
  876.  
  877. #ifdef __cplusplus
  878. extern "C" {
  879. #endif
  880.  
  881. void       _TGdecl arc(int __x, int __y, int __stangle, int __endangle,
  882.               int __radius);
  883. void       _TGdecl bar(int __left, int __top, int __right, int __bottom);
  884. void       _TGdecl bar3d(int __left, int __top, int __right, int __bottom,
  885.             int __depth, int __topflag);
  886. void       _TGdecl circle(int __x, int __y, int __radius);
  887. void       _TGdecl cleardevice(void);
  888. void       _TGdecl clearviewport(void);
  889. void       _TGdecl closegraph(void);
  890. void       _TGdecl detectgraph(int far *__graphdriver,int far *__graphmode);
  891. void       _TGdecl drawpoly(int __numpoints, const int far *__polypoints);
  892. void       _TGdecl ellipse(int __x, int __y, int __stangle, int __endangle,
  893.               int __xradius, int __yradius);
  894. void       _TGdecl fillellipse( int __x, int __y, int __xradius, int __yradius );
  895. void       _TGdecl fillpoly(int __numpoints, const int far *__polypoints);
  896. void       _TGdecl floodfill(int __x, int __y, int __border);
  897. void       _TGdecl getarccoords(struct arccoordstype far *__arccoords);
  898. void       _TGdecl getaspectratio(int far *__xasp, int far *__yasp);
  899. int       _TGdecl getbkcolor(void);
  900. int       _TGdecl getcolor(void);
  901. struct palettetype far * far _TGdecl getdefaultpalette( void );
  902. char *       _TGdecl getdrivername( void );
  903. void       _TGdecl getfillpattern(char far *__pattern);
  904. void       _TGdecl getfillsettings(struct fillsettingstype far *__fillinfo);
  905. int       _TGdecl getgraphmode(void);
  906. void       _TGdecl getimage(int __left, int __top, int __right, int __bottom,
  907.                void far *__bitmap);
  908. void       _TGdecl getlinesettings(struct linesettingstype far *__lineinfo);
  909. int       _TGdecl getmaxcolor(void);
  910. int       _TGdecl getmaxmode(void);
  911. int       _TGdecl getmaxx(void);
  912. int       _TGdecl getmaxy(void);
  913. char *       _TGdecl getmodename( int __mode_number );
  914. void       _TGdecl getmoderange(int __graphdriver, int far *__lomode,
  915.                    int far *__himode);
  916. unsigned   _TGdecl getpixel(int __x, int __y);
  917. void       _TGdecl getpalette(struct palettetype far *__palette);
  918. int       _TGdecl getpalettesize( void );
  919. void       _TGdecl gettextsettings(struct textsettingstype far *__texttypeinfo);
  920. void       _TGdecl getviewsettings(struct viewporttype far *__viewport);
  921. int       _TGdecl getx(void);
  922. int       _TGdecl gety(void);
  923. void       _TGdecl graphdefaults(void);
  924. char *       _TGdecl grapherrormsg(int __errorcode);
  925. /* void       _TGdecl _graphfreemem(void far *__ptr, unsigned __size); */
  926. /* void far * _TGdecl _graphgetmem(unsigned __size); */
  927. int       _TGdecl graphresult(void);
  928. unsigned   _TGdecl imagesize(int __left, int __top, int __right, int __bottom);
  929. void       _TGdecl initgraph(int  far *__graphdriver,int  far *__graphmode,const char far *__pathtodriver);
  930. int       _TGdecl installuserdriver( const char far *__name,int ((*detect)(void)));
  931. int       _TGdecl installuserfont( const char far *__name );
  932. void       _TGdecl line(int __x1, int __y1, int __x2, int __y2);
  933. void       _TGdecl linerel(int __dx, int __dy);
  934. void       _TGdecl lineto(int __x, int __y);
  935. void       _TGdecl moverel(int __dx, int __dy);
  936. void       _TGdecl moveto(int __x, int __y);
  937. void       _TGdecl outtext(const char far *__textstring);
  938. void       _TGdecl outtextxy(int __x, int __y, const char far *__textstring);
  939. void       _TGdecl pieslice(int __x, int __y, int __stangle, int __endangle,
  940.                int __radius);
  941. void       _TGdecl putimage(int __left, int __top, const void far *__bitmap,
  942.                 int __op);
  943. void       _TGdecl putpixel(int __x, int __y, int __color);
  944. void       _TGdecl rectangle(int __left, int __top, int __right, int __bottom);
  945. void       _TGdecl restorecrtmode(void);
  946. void       _TGdecl sector( int __X, int __Y, int __StAngle, int __EndAngle,
  947.               int __XRadius, int __YRadius );
  948. void       _TGdecl setactivepage(int __page);
  949. void       _TGdecl setallpalette(const struct palettetype far *__palette);
  950. void       _TGdecl setaspectratio( int __xasp, int __yasp );
  951. void       _TGdecl setbkcolor(int __color);
  952. void       _TGdecl setcolor(int __color);
  953. void       _TGdecl setfillpattern(const char far *__upattern, int __color);
  954. void       _TGdecl setfillstyle(int __pattern, int __color);
  955. unsigned   _TGdecl setgraphbufsize(unsigned __bufsize);
  956. void       _TGdecl setgraphmode(int __mode);
  957. void       _TGdecl setlinestyle(int __linestyle, unsigned __upattern,
  958.                    int __thickness);
  959. void       _TGdecl setpalette(int __colornum, int __color);
  960. void       _TGdecl setrgbpalette(int __colornum,
  961.                 int __red, int __green, int __blue);
  962. void       _TGdecl settextjustify(int __horiz, int __vert);
  963. void       _TGdecl settextstyle(int __font, int __direction, int __charsize);
  964. void       _TGdecl setusercharsize(int __multx, int __divx,
  965.                   int __multy, int __divy);
  966. void       _TGdecl setviewport(int __left, int __top, int __right, int __bottom,
  967.                   int __clip);
  968. void       _TGdecl setvisualpage(int __page);
  969. void       _TGdecl setwritemode( int __mode );
  970. int       _TGdecl textheight(const char far *__textstring);
  971. int       _TGdecl textwidth(const char far *__textstring);
  972.  
  973. /***** graphics drivers *****/
  974.  
  975. int       _TGdecl registerbgidriver(void (*driver)(void));
  976.  
  977.  
  978. /***** graphics fonts *****/
  979.  
  980. int           _TGdecl registerbgifont(void (*font)(void));
  981.  
  982. /* !!    These "functions" are NOT user-callable,   !! */
  983. /* !! they are there just so you can link in fonts !! */
  984.  
  985. void           cdecl   triplex_font(void);
  986. void           cdecl     small_font(void);
  987. void           cdecl sansserif_font(void);
  988. void           cdecl    gothic_font(void);
  989.  
  990. #ifdef __cplusplus
  991. }
  992. #endif
  993. #endif
  994. /*    virtmem.h
  995.  
  996.     Defines structs and functions for dealing with the virtual Memory
  997.     Manager.
  998.  
  999.     Copyright (c) TEGL Systems Corporation 1989,1990
  1000.     All Rights Reserved.
  1001. */
  1002.  
  1003. #ifndef __VIRTMEM_H
  1004. #define __VIRTMEM_H
  1005.  
  1006. #ifdef __STDTEGL__
  1007. #define _TGdecl
  1008. #else
  1009. #define _TGdecl  cdecl
  1010. #endif
  1011.  
  1012. #ifndef __PASTEGL__
  1013. #define _TGType _TGdecl
  1014. #else
  1015. #define _TGType pascal
  1016. #endif
  1017.  
  1018. typedef int (*allocerror) (unsigned long heapsize);
  1019.  
  1020. typedef struct freelistrec *freelistptr;
  1021. typedef struct freelistrec {
  1022.     void far       *orgptr;
  1023.     void far       *endptr;
  1024. } freelistrec;
  1025.  
  1026. typedef struct ofsseg *segofs;
  1027. typedef struct ofsseg {
  1028.     unsigned    offset;
  1029.     unsigned    segment;
  1030. } ofsseg;
  1031.  
  1032. #ifndef TGMK_FP
  1033. #define TGMK_FP(seg,ofs)  ((void far *) (((unsigned long)(seg) << 16) | (unsigned)(ofs)))
  1034. #endif
  1035.  
  1036. #define ORGPTR_FP(fp) ((freelistptr) (fp))->orgptr
  1037. #define ENDPTR_FP(fp) ((freelistptr) (fp))->endptr
  1038. #define OFFSET_FP(fp) ((segofs) &(fp))->offset
  1039. #define SEGMENT_FP(fp) ((segofs) &(fp))->segment
  1040. #define NORM_FP(fp)  TGMK_FP(SEGMENT_FP(fp)+(OFFSET_FP(fp) >> 4),(OFFSET_FP(fp) & 0x000F))
  1041. #define LINEAR_FP(fp) ((unsigned long) SEGMENT_FP(fp)<<4) + ((unsigned long) OFFSET_FP(fp))
  1042. #define POINTER_FP(fp) TGMK_FP( (unsigned)((fp) >> 4),(unsigned)((fp) & 0x000F))
  1043. #define PTRDIFF_FP(fp1,fp2) ((unsigned long) LINEAR_FP(fp1)) - ((unsigned long) LINEAR_FP(fp2))
  1044.  
  1045.  
  1046.  
  1047. #ifdef __cplusplus
  1048. extern "C" {
  1049. #endif
  1050.  
  1051. extern void far * _TGType tfreeptr;
  1052. extern void far       *theaporg;
  1053. extern void far       *theapptr;
  1054. extern unsigned        freemin;
  1055. extern unsigned long   hugemin;
  1056. extern unsigned long   standardheapsize;
  1057. extern allocerror      hugeheaperror;
  1058. extern allocerror      virtmemerror;
  1059. extern char           heapmeminit;
  1060. extern unsigned long   upperheapsize;
  1061.  
  1062. void          _TGdecl setstandardheapsize(unsigned long heapsize);
  1063. void          _TGdecl reservehugeminimum(unsigned long minimumsize);
  1064. void          _TGdecl initteglheap(void);
  1065.  
  1066. void far     *_TGdecl cgetmem(unsigned long heapsize);
  1067. unsigned long _TGdecl reservedmemavail(void);
  1068. unsigned long _TGdecl reservedmaxavail(void);
  1069. unsigned long _TGdecl cmaxavail(void);
  1070. unsigned long _TGdecl cmemavail(void);
  1071. void far     *_TGdecl fgetmem(unsigned long heapsize);
  1072. void          _TGdecl cfreemem(void far * freeorgptr,unsigned long heapsize);
  1073.  
  1074. #ifndef NOVIRT
  1075. /*-----------------------------------------------------------------------*/
  1076.  
  1077. typedef void   (*errorproc) (int errcode);
  1078. typedef char   signate[5];
  1079. typedef struct vdskfreerecord *vdskfreeptr;
  1080. typedef struct vdskfilerecord *vdskfile;
  1081. typedef struct emsblock *emsblockptr;
  1082. typedef struct emsfilerec *emsfile;
  1083.  
  1084. typedef struct emsblock {
  1085.     emsblockptr    nextblockptr;
  1086.     unsigned    handle; /* Multiple handles */
  1087.     unsigned    emspage;/* Pages allocated */
  1088. } emsblock;
  1089.  
  1090. typedef struct emsfilerec {
  1091.     unsigned    pageoffset;    /* current offset within page */
  1092.     unsigned    baseaddress;
  1093.     unsigned long    emsposition;
  1094.     unsigned    totalpages;    /* Total number of 16k pages */
  1095.     emsblockptr    rootblkptr;
  1096. } emsfilerec;
  1097.  
  1098. typedef struct vdskfreerecord {
  1099.     vdskfreeptr    nextvdskfree;
  1100.     unsigned long    startblock;
  1101.     unsigned long    endblock;
  1102.     signate     signature;
  1103.     char        blockfree;
  1104. } vdskfreerecord;
  1105.  
  1106. typedef struct vdskblocksizerecord {
  1107.     unsigned long    bsize;
  1108.     unsigned long    realsize;
  1109.     signate     signature;
  1110.     char        blockfree;
  1111.     unsigned    chksum;
  1112. } vdskblocksizerecord;
  1113.  
  1114. typedef struct vdskfilerecord {
  1115.     vdskfreeptr    vdskfreeptrchain;
  1116.     unsigned long    vdsktopoffile;
  1117.     unsigned    vdskattribute;
  1118.     unsigned long    vdskpacketsave;
  1119.     char           *vdskfilename;
  1120.     char        emstype;/* Selector */
  1121.     union v {
  1122.         int        vdskheapfile;
  1123.         emsfile     vemsheapfile;
  1124.     }        v;
  1125. } vdskfilerecord;
  1126.  
  1127. #ifndef __VIRTSTRUC
  1128. #define __VIRTSTRUC
  1129. typedef struct virtualrec *virtualptr;
  1130. typedef struct virtualrec {
  1131.     virtualptr    nxtptr;
  1132.     virtualptr    lstptr;
  1133.     unsigned long    memorysize;
  1134.     char far       *memoryptr;
  1135.     unsigned char    memorylock;
  1136.     unsigned char    memoryinuse;
  1137.     unsigned char    memorypageout;
  1138.     unsigned long    memorypageptr;
  1139.     void far      **vpreferback;
  1140.     char far       *vplastmemptr;
  1141.     unsigned char    memorylevel;
  1142. } virtualrec;
  1143. #endif
  1144.  
  1145. extern unsigned ems_status;
  1146. extern unsigned vdskstatus;
  1147. extern errorproc vdskerror;
  1148. extern char virtualsound;
  1149. extern char triedems;
  1150. extern errorproc virtualerror;
  1151. extern unsigned virtdskemsinitpages;
  1152.  
  1153. #define virtsound(yesno) virtualsound = yesno
  1154. #define useharddisk(yesno) triedems = yesno
  1155. #define setvirtdskemsmax(maxsize) virtdskemsinitpages = maxsize
  1156. #define vdskreadwrite  1
  1157. #define vdsktemporary  2
  1158.  
  1159. char          _TGdecl emminstalled(void);
  1160. unsigned      _TGdecl emspagesavailable(unsigned * total_ems_pages,unsigned * pages_available);
  1161. unsigned      _TGdecl allocateexpandedmemorypages(unsigned pages_needed,unsigned * handle);
  1162. unsigned      _TGdecl mapexpandedmemorypages(unsigned handle,unsigned logical_page,unsigned physical_page);
  1163. unsigned      _TGdecl getpageframebaseaddress(unsigned * page_frame_address);
  1164. unsigned      _TGdecl deallocateexpandedmemorypages(unsigned handle);
  1165. unsigned      _TGdecl getversionnumber(char * version_string);
  1166. unsigned      _TGdecl gethandlecountused(unsigned * numberofhandles);
  1167. unsigned      _TGdecl getpagesownedbyhandle(unsigned handle,unsigned * pagesowned);
  1168. emsfile       _TGdecl emsopen(unsigned minimumpages);
  1169. void          _TGdecl emsseek(emsfile emsramfile,unsigned long position);
  1170. void          _TGdecl emsblockwrite(emsfile emsramfile,char *buffer,unsigned long bytestowrite);
  1171. void          _TGdecl emsblockread(emsfile emsramfile,char *buffer,unsigned long bytestoread);
  1172. void          _TGdecl emsclose(emsfile emsramfile);
  1173. void          _TGdecl movefromvirtual(char far * dataptr,unsigned long virtualheapptr);
  1174. unsigned long _TGdecl movetovirtual(char far * dataptr,unsigned long heapsize);
  1175. void          _TGdecl freevirtual(unsigned long virtualheapptr);
  1176. unsigned long _TGdecl vdskgetmem(vdskfile vdskpacket,unsigned long heapsize,char *signature);
  1177. void          _TGdecl vdskfreemem(vdskfile vdskpacket,unsigned long vdskheapptr);
  1178. void          _TGdecl vdskwriteheapdata(vdskfile vdskpacket,char far * dataptr,unsigned long vdskheapptr);
  1179. void          _TGdecl vdskreadheapdata(vdskfile vdskpacket,char far * dataptr,unsigned long vdskheapptr);
  1180. void          _TGdecl vdskcloseheapfile(vdskfile vdskpacket);
  1181. vdskfile      _TGdecl vdskopenheapfile(char *vdskfilename,unsigned vdskattribute);
  1182. vdskfile      _TGdecl vemsopenheapfile(int initialalloc);
  1183. unsigned long _TGdecl virtualmemused(void);
  1184.  
  1185. /*-----------------------------------------------------------------------*/
  1186. #endif    /* NOVIRT */
  1187.  
  1188. void          _TGdecl setstandardheapsize(unsigned long heapsize);
  1189. void          _TGdecl vpunlock(virtualptr vp);
  1190. void          _TGdecl vplock(virtualptr vp);
  1191. unsigned char _TGdecl vmpageout(unsigned long memrequest);
  1192. void          _TGdecl vpuse(virtualptr vp);
  1193. void          _TGdecl vpaccess(virtualptr vp,void**rfptr);
  1194. void          _TGdecl vpgetmem(virtualptr * vp, unsigned long heapsize);
  1195. void          _TGdecl vpfreemem(virtualptr vp);
  1196. void          _TGdecl vppageout(virtualptr vp);
  1197. void          _TGdecl vppagein(virtualptr vp);
  1198. void          _TGdecl vpunuse(virtualptr vp);
  1199. void          _TGdecl vmsetlevel(unsigned char level);
  1200. unsigned char _TGdecl vmgetlevel(void);
  1201. void          _TGdecl pushvplevel(void);
  1202. void          _TGdecl popvplevel(void);
  1203. void          _TGdecl monitorcheck(unsigned long rmax, unsigned long rmem, unsigned long moremem);
  1204. void          _TGdecl setmonitorthresholds(unsigned long rmax, unsigned long rmem, unsigned long moremem);
  1205. int          _TGdecl memoryshuffle(unsigned long size);
  1206.  
  1207. #ifdef __cplusplus
  1208. }
  1209. #endif
  1210.  
  1211. #endif
  1212. /*    teglintr.h
  1213.  
  1214.     Defines structs and functions for dealing with system Interrupts.
  1215.  
  1216.     Copyright (c) TEGL Systems Corporation 1989,1990
  1217.     All Rights Reserved.
  1218. */
  1219.  
  1220. #ifndef __TEGLINTR_H
  1221. #define __TEGLINTR_H
  1222.  
  1223. #ifdef __STDTEGL__
  1224. #define _TGdecl
  1225. #else
  1226. #define _TGdecl  cdecl
  1227. #endif
  1228.  
  1229. #ifndef __PASTEGL__
  1230. #define _TGType _TGdecl
  1231. #else
  1232. #define _TGType pascal
  1233. #endif
  1234.  
  1235. #ifndef __FASTGRPH_H
  1236. #include <fastgrph.h>
  1237. #endif
  1238.  
  1239. typedef unsigned char (far *funccallproc)(void);
  1240.  
  1241. typedef struct keyflags *keyrecptr;
  1242. typedef struct keyflags {
  1243.      keyrecptr     nextkeyflag;
  1244.      unsigned char repeatkey;
  1245.      unsigned      keycode;
  1246.      funccallproc  keycall;
  1247. } keyflags;
  1248.  
  1249. typedef struct timeflags *timerecptr;
  1250. typedef struct timeflags {
  1251.       timerecptr   nexttimeflag;
  1252.       unsigned     timercount;
  1253.       unsigned     timerstart;
  1254.       char           timerflag;
  1255.       funccallproc timercall;
  1256. } timeflags;
  1257.  
  1258. #define sk_noshift     0x01
  1259. #define sk_rightshift  0x01
  1260. #define sk_leftshift   0x02
  1261. #define sk_ctrlshift   0x04
  1262. #define sk_altshift    0x08
  1263. #define sk_scrolllock  0x10
  1264. #define sk_numlock     0x20
  1265. #define sk_capslock    0x40
  1266. #define sk_inslock     0x80
  1267. #define bios_data      0x40
  1268.  
  1269. #define key_esc        0x01
  1270. #define key_a           0x1E
  1271. #define key_b           0x30
  1272. #define key_c           0x2E
  1273. #define key_d           0x20
  1274. #define key_e           0x12
  1275. #define key_f           0x21
  1276. #define key_g           0x22
  1277. #define key_h           0x23
  1278. #define key_i           0x17
  1279. #define key_j           0x24
  1280. #define key_k           0x25
  1281. #define key_l           0x26
  1282. #define key_m           0x32
  1283. #define key_n           0x31
  1284. #define key_o           0x18
  1285. #define key_p           0x19
  1286. #define key_q           0x10
  1287. #define key_r           0x13
  1288. #define key_s           0x1F
  1289. #define key_t           0x14
  1290. #define key_u           0x16
  1291. #define key_v           0x2F
  1292. #define key_w           0x11
  1293. #define key_x           0x2D
  1294. #define key_y           0x15
  1295. #define key_z           0x2C
  1296.  
  1297. #define key_1           0x02
  1298. #define key_2           0x03
  1299. #define key_3           0x04
  1300. #define key_4           0x05
  1301. #define key_5           0x06
  1302. #define key_6           0x07
  1303. #define key_7           0x08
  1304. #define key_8           0x09
  1305. #define key_9           0x0A
  1306. #define key_0           0x0B
  1307.  
  1308. #define key_f1           0x3B
  1309. #define key_f2           0x3C
  1310. #define key_f3           0x3D
  1311. #define key_f4           0x3E
  1312. #define key_f5           0x3F
  1313. #define key_f6           0x40
  1314. #define key_f7           0x41
  1315. #define key_f8           0x42
  1316. #define key_f9           0x43
  1317. #define key_f10        0x44
  1318.  
  1319. #define key_space      0x39
  1320. #define key_enter      0x1C
  1321. #define key_tab        0x0F
  1322. #define key_sysreq     0x54
  1323. #define key_backspace  0x0E
  1324. #define key_ins        0x52
  1325. #define key_del        0x53
  1326.  
  1327. #define key_home       0x47
  1328. #define key_uparrow    0x48
  1329. #define key_pgup       0x49
  1330. #define key_leftarrow  0x4B
  1331. #define key_rightarrow 0x4D
  1332. #define key_downarrow  0x50
  1333. #define key_end        0x4F
  1334. #define key_pgdn       0x51
  1335.  
  1336. #define key_numlock    0x45
  1337. #define key_scrolllock 0x46
  1338. #define key_ctrl       0x1D
  1339. #define key_shift      0x2A
  1340. #define key_alt        0x38
  1341. #define key_capslock   0x3A
  1342.  
  1343. #define key_minus      0x0C
  1344. #define key_equal      0x0D
  1345. #define key_period     0x34
  1346. #define key_lbracket   0x1A
  1347. #define key_rbracket   0x1B
  1348. #define key_coma       0x33
  1349. #define key_semi       0x27
  1350. #define key_rquote     0x28
  1351. #define key_lquote     0x29
  1352. #define key_asterisk   0x37
  1353. #define key_grayminus  0x4A
  1354. #define key_center5    0x4C
  1355. #define key_grayplus   0x4E
  1356.  
  1357. #define key_backslash  0x2B
  1358. #define key_forwslash  0x35
  1359.  
  1360. extern    char volatile scancodetable[128];
  1361. extern    char asciiscancode[128];
  1362.  
  1363. extern    unsigned char volatile timerignore;
  1364. extern    unsigned char volatile timerbusy;
  1365. extern    unsigned char controlbreakflag;
  1366.  
  1367. extern    unsigned char volatile far *kb_flag;
  1368. extern    unsigned char mouse_installed;
  1369.  
  1370. extern    unsigned      volatile _TGType mouse_buttons;
  1371. extern    unsigned char volatile _TGType kbmousebusy;
  1372. extern    unsigned char _TGType mouseshow;
  1373. extern    int          volatile _TGType mouse_xcoord;
  1374. extern    int          volatile _TGType mouse_ycoord;
  1375. extern    unsigned      volatile _TGType mouse_event;
  1376. extern    unsigned char volatile _TGType leftbuttondouble;
  1377. extern    unsigned      volatile _TGType leftbuttontimerem;
  1378. extern    unsigned      _TGType leftbuttonpress;
  1379. extern    unsigned      _TGType leftpressxcoord;
  1380. extern    unsigned      _TGType leftpressycoord;
  1381. extern    unsigned      _TGType leftbuttonrelease;
  1382. extern    unsigned      _TGType leftreleasexcoord;
  1383. extern    unsigned      _TGType leftreleaseycoord;
  1384. extern    unsigned char volatile _TGType rightbuttondouble;
  1385. extern    unsigned      volatile _TGType rightbuttontimerem;
  1386. extern    unsigned      _TGType rightbuttonpress;
  1387. extern    unsigned      _TGType rightpressxcoord;
  1388. extern    unsigned      _TGType rightpressycoord;
  1389. extern    unsigned      _TGType rightbuttonrelease;
  1390. extern    unsigned      _TGType rightreleasexcoord;
  1391. extern    unsigned      _TGType rightreleaseycoord;
  1392. extern    unsigned char volatile _TGType middlebuttondouble;
  1393. extern    unsigned      volatile _TGType middlebuttontimerem;
  1394. extern    unsigned      _TGType middlebuttonpress;
  1395. extern    unsigned      _TGType middlepressxcoord;
  1396. extern    unsigned      _TGType middlepressycoord;
  1397. extern    unsigned      _TGType middlebuttonrelease;
  1398. extern    unsigned      _TGType middlereleasexcoord;
  1399. extern    unsigned      _TGType middlereleaseycoord;
  1400. extern    unsigned      _TGType doubleclickspeed;
  1401.  
  1402. extern masktype pointinghand;
  1403. extern masktype hourglass;
  1404. extern masktype standard;
  1405. extern masktype diagcross;
  1406. extern masktype checkmark;
  1407. extern masktype maskcursor;
  1408.  
  1409. #ifdef __cplusplus
  1410. extern "C" {
  1411. #endif
  1412.  
  1413.  
  1414. unsigned char _TGdecl leftdoubleclick(void);
  1415. unsigned char _TGdecl rightdoubleclick(void);
  1416. unsigned char _TGdecl middledoubleclick(void);
  1417. void          _TGdecl setmousesensitivity(unsigned x_sense,unsigned y_sense,unsigned threshold);
  1418. void          _TGdecl getmousesensitivity(unsigned *x_sense,unsigned *y_sense,unsigned *threshold);
  1419. void          _TGdecl setmouseminmax(unsigned minx,unsigned miny,unsigned maxx,unsigned maxy);
  1420. void          _TGdecl showmouse(void);
  1421. void          _TGdecl hidemouse(void);
  1422. void          _TGdecl setmouseposition(unsigned mousex,unsigned mousey);
  1423. void          _TGType setmousepos(unsigned xpos,unsigned ypos);
  1424. void          _TGdecl cursorshape(void *shape);
  1425. void          _TGdecl setmousemask(void *shape, unsigned x, unsigned y);
  1426. unsigned      _TGdecl mouseposition(unsigned *mousex,unsigned *mousey);
  1427. void          _TGdecl setmousehotspot(unsigned x,unsigned y);
  1428. void          _TGdecl setmousecolor(unsigned color);
  1429. void          _TGdecl setkeyboardmouse(unsigned char on_off);
  1430. void          _TGdecl setkbsteps(unsigned xsteps,unsigned ysteps,unsigned sfxsteps,unsigned sfysteps);
  1431. void          _TGdecl getkbsteps(unsigned *xsteps,unsigned *ysteps,unsigned *sfxsteps,unsigned *sfysteps);
  1432. void          _TGdecl getbuttonreleaseinfo(unsigned button,unsigned *buttonstat,
  1433.              unsigned *buttonrelease,unsigned *xpos,unsigned *ypos);
  1434. void          _TGdecl getbuttonpressinfo(unsigned button,unsigned *buttonstat,
  1435.              unsigned *buttonpresses,unsigned *xpos,unsigned *ypos);
  1436. void          _TGdecl clearbuttoninfo(void);
  1437. void          _TGdecl frozenmouse(void);
  1438. unsigned char _TGdecl freezemouse(unsigned x,unsigned y,unsigned x1,unsigned y1);
  1439. void          _TGdecl unfreezemouse(char mshow);
  1440. void          _TGdecl swaptimerout(void);
  1441. void          _TGdecl swaptimerin(void);
  1442. void          _TGdecl settimerstart(timerecptr *timepiece,unsigned timeset);
  1443. void          _TGdecl settimercallprocstart(timerecptr * timepiece, unsigned timeset, funccallproc timercallproc);
  1444. void          _TGdecl resettimerflag(timerecptr timepiece);
  1445. void          _TGdecl droptimercount(timerecptr timepiece);
  1446. void          _TGdecl timerswitch(unsigned char onoff);
  1447. void          _TGdecl swapteglintroff(void);
  1448. void          _TGdecl swapteglintron(void);
  1449. unsigned      _TGdecl teglreadkey(void);
  1450. char          _TGdecl teglkeypressed(void);
  1451. void          _TGdecl addcapturekey(unsigned keycode,unsigned char repeatkey,funccallproc keycall);
  1452. void          _TGdecl deletecapturekey(unsigned keycode);
  1453. unsigned      _TGdecl key(unsigned char shiftbits,unsigned char keycode);
  1454. void          _TGdecl setshiftkeys(unsigned char shiftflag,unsigned char onoff);
  1455. void          _TGdecl txtcursorpos(unsigned x1, unsigned y1);
  1456. void          _TGdecl txtcursoron(void);
  1457. void          _TGdecl txtcursoroff(void);
  1458. void          _TGdecl txtcursorstop(void);
  1459. void          _TGdecl txtcursorinit(unsigned x1, unsigned y1, unsigned x2, unsigned y2,
  1460.                     unsigned blinktime, unsigned color, char * iconcursor);
  1461. unsigned char _TGdecl txtcursorblink(void);
  1462. void          _TGdecl txtcursorresume(void);
  1463. void          _TGdecl txtcursorfreeze(void);
  1464. void          _TGdecl init_teglintr(void);
  1465.  
  1466.  
  1467. unsigned      _TGType initmouse(void);
  1468. void          _TGType mousereset(void);
  1469.  
  1470. #ifdef __cplusplus
  1471. }
  1472. #endif
  1473.  
  1474. #endif
  1475. /*    iconsys.h
  1476.  
  1477.     Defines prototype constants for TEGL icons
  1478.  
  1479.     Copyright (c) TEGL Systems Corporation 1989,1990
  1480.     All Rights Reserved.
  1481. */
  1482.  
  1483. #ifndef __ICONSYS_H
  1484. #define __ICONSYS_H
  1485.  
  1486. extern unsigned char imageARROWLF[];
  1487. extern unsigned char imageARROWDN[];
  1488. extern unsigned char imageARROWRT[];
  1489. extern unsigned char imageARROWUP[];
  1490. extern unsigned char imageBAR[];
  1491. extern unsigned char imageBELL[];
  1492. extern unsigned char imageBELL2[];
  1493. extern unsigned char imageBLANKBUT[];
  1494. extern unsigned char imageBULB[];
  1495. extern unsigned char imageC[];
  1496. extern unsigned char imageCANCEL[];
  1497. extern unsigned char imageCHK7X6[];
  1498. extern unsigned char imageCHK8X10[];
  1499. extern unsigned char imageCHK8X12[];
  1500. extern unsigned char imageCHK8X8[];
  1501. extern unsigned char imageCLOCK[];
  1502. extern unsigned char imageCOMPUTER[];
  1503. extern unsigned char imageCORNER[];
  1504. extern unsigned char imageCORNER2[];
  1505. extern unsigned char imageCORNER3[];
  1506. extern unsigned char imageCREDITS[];
  1507. extern unsigned char imageDISK[];
  1508. extern unsigned char imageDISK35[];
  1509. extern unsigned char imageDISKDRV[];
  1510. extern unsigned char imageDOCUMENT[];
  1511. extern unsigned char imageDOWN[];
  1512. extern unsigned char imageDRAWER[];
  1513. extern unsigned char imageFILE[];
  1514. extern unsigned char imageFIND[];
  1515. extern unsigned char imageKEYBOARD[];
  1516. extern unsigned char imageKEYBRD2[];
  1517. extern unsigned char imageLAST[];
  1518. extern unsigned char imageLBUT[];
  1519. extern unsigned char imageLEFT[];
  1520. extern unsigned char imageMBUT[];
  1521. extern unsigned char imageMC[];
  1522. extern unsigned char imageMONITOR[];
  1523. extern unsigned char imageMOUSE[];
  1524. extern unsigned char imageMOUSE2[];
  1525. extern unsigned char imageMUSIC[];
  1526. extern unsigned char imageMUSIC2[];
  1527. extern unsigned char imageNEXT[];
  1528. extern unsigned char imageNOTE[];
  1529. extern unsigned char imageNOTE2[];
  1530. extern unsigned char imageOK[];
  1531. extern unsigned char imagePREV[];
  1532. extern unsigned char imagePRINTER[];
  1533. extern unsigned char imageQUESTN2[];
  1534. extern unsigned char imageR[];
  1535. extern unsigned char imageRBUT[];
  1536. extern unsigned char imageREAD[];
  1537. extern unsigned char imageRESIZE[];
  1538. extern unsigned char imageRIGHT[];
  1539. extern unsigned char imageSLIDER[];
  1540. extern unsigned char imageSLIDER2[];
  1541. extern unsigned char imageSTOPSIGN[];
  1542. extern unsigned char imageSUBMENU[];
  1543. extern unsigned char imageSYSTEM[];
  1544. extern unsigned char imageTIGER[];
  1545. extern unsigned char imageTINYTEGL[];
  1546. extern unsigned char imageTRASH[];
  1547. extern unsigned char imageUP[];
  1548. extern unsigned char imageVS[];
  1549. extern unsigned char imageWFDN[];
  1550. extern unsigned char imageWFUP[];
  1551. extern unsigned char imageWFICON[];
  1552. extern unsigned char imageWFLF[];
  1553. extern unsigned char imageWFRT[];
  1554. extern unsigned char imageWFUD[];
  1555. extern unsigned char imageWFBAR[];
  1556. extern unsigned char imageWRITE[];
  1557. extern unsigned char imageWFMDN[];
  1558.  
  1559. #endif
  1560. /*    fontsys.h
  1561.  
  1562.     declaration for TEGL fonts
  1563.  
  1564.     Copyright (c) TEGL Systems Corporation 1989,1990
  1565.     All Rights Reserved.
  1566. */
  1567.  
  1568. #ifdef __STDTEGL__
  1569. #define _TGdecl
  1570. #else
  1571. #define _TGdecl  cdecl
  1572. #endif
  1573.  
  1574. #ifndef __PASTEGL__
  1575. #define _TGType _TGdecl
  1576. #else
  1577. #define _TGType pascal
  1578. #endif
  1579.  
  1580. #ifndef __FONTSYS_H
  1581. #define __FONTSYS_H
  1582.  
  1583. #ifdef __cplusplus
  1584. extern "C" {
  1585. #endif
  1586.  
  1587. #ifdef __TSC__
  1588. void far antiqu25(void);
  1589. void far apls7(void);
  1590. void far bigsf25(void);
  1591. void far block25(void);
  1592. void far brdwx19(void);
  1593. void far broadway(void);
  1594. void far bway25(void);
  1595. void far countdwn(void);
  1596. void far cour25(void);
  1597. void far defa25(void);
  1598. void far ega09(void);
  1599. void far f5x6norm(void);
  1600. void far f6x6norm(void);
  1601. void far f7x7bold(void);
  1602. void far f7x7norm(void);
  1603. void far f8x12bol(void);
  1604. void far f8x12nor(void);
  1605. void far f8x8bold(void);
  1606. void far f8x8ital(void);
  1607. void far f8x8norm(void);
  1608. void far font07(void);
  1609. void far font07cp(void);
  1610. void far font09(void);
  1611. void far font14(void);
  1612. void far fraktur(void);
  1613. void far fresn25(void);
  1614. void far future(void);
  1615. void far gaelic(void);
  1616. void far georgian(void);
  1617. void far italic(void);
  1618. void far kids25(void);
  1619. void far lcdfont(void);
  1620. void far light14(void);
  1621. void far light9(void);
  1622. void far litalic(void);
  1623. void far m3270(void);
  1624. void far normss25(void);
  1625. void far ocr(void);
  1626. void far oenglish(void);
  1627. void far pc24(void);
  1628. void far pc3270(void);
  1629. void far pc9(void);
  1630. void far roman25(void);
  1631. void far sansx19(void);
  1632. void far script(void);
  1633. void far script2(void);
  1634. void far thin25(void);
  1635. void far wndwx19(void);
  1636. #else
  1637. void far cdecl antiqu25(void);
  1638. void far cdecl apls7(void);
  1639. void far cdecl bigsf25(void);
  1640. void far cdecl block25(void);
  1641. void far cdecl brdwx19(void);
  1642. void far cdecl broadway(void);
  1643. void far cdecl bway25(void);
  1644. void far cdecl countdwn(void);
  1645. void far cdecl cour25(void);
  1646. void far cdecl defa25(void);
  1647. void far cdecl ega09(void);
  1648. void far cdecl f5x6norm(void);
  1649. void far cdecl f6x6norm(void);
  1650. void far cdecl f7x7bold(void);
  1651. void far cdecl f7x7norm(void);
  1652. void far cdecl f8x12bol(void);
  1653. void far cdecl f8x12nor(void);
  1654. void far cdecl f8x8bold(void);
  1655. void far cdecl f8x8ital(void);
  1656. void far cdecl f8x8norm(void);
  1657. void far cdecl font07(void);
  1658. void far cdecl font07cp(void);
  1659. void far cdecl font09(void);
  1660. void far cdecl font14(void);
  1661. void far cdecl fraktur(void);
  1662. void far cdecl fresn25(void);
  1663. void far cdecl future(void);
  1664. void far cdecl gaelic(void);
  1665. void far cdecl georgian(void);
  1666. void far cdecl italic(void);
  1667. void far cdecl kids25(void);
  1668. void far cdecl lcdfont(void);
  1669. void far cdecl light14(void);
  1670. void far cdecl light9(void);
  1671. void far cdecl litalic(void);
  1672. void far cdecl m3270(void);
  1673. void far cdecl normss25(void);
  1674. void far cdecl ocr(void);
  1675. void far cdecl oenglish(void);
  1676. void far cdecl pc24(void);
  1677. void far cdecl pc3270(void);
  1678. void far cdecl pc9(void);
  1679. void far cdecl roman25(void);
  1680. void far cdecl sansx19(void);
  1681. void far cdecl script(void);
  1682. void far cdecl script2(void);
  1683. void far cdecl thin25(void);
  1684. void far cdecl wndwx19(void);
  1685. #endif
  1686.  
  1687. #ifdef __cplusplus
  1688. }
  1689. #endif
  1690. #endif
  1691. /*    ipstacks.h
  1692.  
  1693.     Defines structs and functions for the image partial core routines
  1694.  
  1695.     Copyright (c) TEGL Systems Corporation 1989,1990,1991
  1696.     All Rights Reserved.
  1697. */
  1698.  
  1699. #ifndef __IPSTACKS_H
  1700. #define __IPSTACKS_H
  1701.  
  1702. #ifdef __STDTEGL__
  1703. #define _TGdecl
  1704. #else
  1705. #define _TGdecl  cdecl
  1706. #endif
  1707.  
  1708. #ifndef __PASTEGL__
  1709. #define _TGType _TGdecl
  1710. #else
  1711. #define _TGType pascal
  1712. #endif
  1713.  
  1714. #ifndef __VIRTMEM_H
  1715. #include <VIRTMEM.H>
  1716. #endif
  1717.  
  1718. typedef struct imageslice *imagepartial;
  1719. typedef struct imageslice {
  1720.     imagepartial nxtptr;
  1721.     imagepartial lstptr;
  1722.     imagepartial nxtip;        /* chained IP image */
  1723.     unsigned x, y, x1, y1;
  1724.     unsigned long imagesize;
  1725.     virtualptr imagesave;
  1726.     unsigned char imageactive;
  1727.     unsigned mouseshow;
  1728.     imagepartial partialstack;
  1729.     unsigned char prepareupdate;
  1730.     unsigned preparecount;
  1731. } imageslice;
  1732.  
  1733. extern imagepartial ipstack;
  1734.  
  1735. #ifdef __cplusplus
  1736. extern "C" {
  1737. #endif
  1738.  
  1739. void         _TGdecl ipcreatepartial(imagepartial *ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
  1740. void         _TGdecl ipcreateemptypartial(imagepartial *ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
  1741. void         _TGdecl iplink(imagepartial nip,imagepartial cip);
  1742. void         _TGdecl iplinkunder(imagepartial nip,imagepartial cip);
  1743. void         _TGdecl ippushimage(unsigned x,unsigned y,unsigned x1,unsigned y1);
  1744. void         _TGdecl ippopimage(void);
  1745. void         _TGdecl ipsetcoord(imagepartial ip,unsigned x1,unsigned y1,unsigned x2,unsigned y2);
  1746. void         _TGdecl ipunlink(imagepartial cip);
  1747. void         _TGdecl ipinsert(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
  1748. imagepartial _TGdecl ipstackpartials(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
  1749. void         _TGdecl ipmerge(imagepartial tp1,imagepartial tp2,unsigned x,unsigned y,unsigned x1,unsigned y1);
  1750. void         _TGdecl ipputpartial(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
  1751. void         _TGdecl ippreparepartial(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
  1752. void         _TGdecl ipprepareupdate(imagepartial ip);
  1753. void         _TGdecl ipgetpartial(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
  1754. void         _TGdecl ipcommitupdate(void);
  1755. void         _TGdecl ipcommitimg(imagepartial lstptr,imagepartial tp);
  1756. void         _TGdecl iprotate(imagepartial ip1,imagepartial ip2);
  1757. void         _TGdecl iprotateunder(imagepartial ip1,imagepartial ip2);
  1758. void         _TGdecl ipmoveimage(imagepartial ip,unsigned x,unsigned y);
  1759. void         _TGdecl ipdropimage(imagepartial ip);
  1760. void         _TGdecl ipfreebuffers(imagepartial ip);
  1761. void         _TGdecl ipdroppartial(imagepartial ip);
  1762. imagepartial _TGdecl ippreppartial(imagepartial ip,imagepartial tp,unsigned x,unsigned y,unsigned x1,unsigned y1);
  1763. imagepartial _TGdecl ipprepupdate(imagepartial ip,imagepartial tp);
  1764. imagepartial _TGdecl ipgetpartialfront(imagepartial ip,unsigned x,unsigned y,unsigned x1,unsigned y1);
  1765. imagepartial _TGdecl ipgetfront(imagepartial ip);
  1766. void         _TGdecl iphideimage(imagepartial ip);
  1767. void         _TGdecl ipshowimage(imagepartial ip,unsigned x,unsigned y);
  1768. void         _TGdecl ipgetimage(unsigned x,unsigned y,imagepartial ip);
  1769. void         _TGdecl ipputimage(unsigned x,unsigned y,imagepartial ip,unsigned rmwbits);
  1770.  
  1771. #ifdef __cplusplus
  1772. }
  1773. #endif
  1774.  
  1775. #endif
  1776. /*    teglunit.h
  1777.  
  1778.     Defines structs and functions for TEGL core routines
  1779.  
  1780.     Copyright (c) TEGL Systems Corporation 1989,1990,1991
  1781.     All Rights Reserved.
  1782. */
  1783.  
  1784. #ifndef __TEGLUNIT_H
  1785. #define __TEGLUNIT_H
  1786.  
  1787. #ifdef __STDTEGL__
  1788. #define _TGdecl
  1789. #else
  1790. #define _TGdecl  cdecl
  1791. #endif
  1792.  
  1793. #ifndef __PASTEGL__
  1794. #define _TGType _TGdecl
  1795. #else
  1796. #define _TGType pascal
  1797. #endif
  1798.  
  1799. #define MSSENSE   TRUE
  1800. #define MSCLICK   FALSE
  1801.  
  1802. #ifndef __TEGLINTR_H
  1803. #include <TEGLINTR.H>
  1804. #endif
  1805. #ifndef __IPSTACKS_H
  1806. #include <IPSTACKS.H>
  1807. #endif
  1808.  
  1809. /*
  1810.  * The four pointers below provides the total integration of TEGL, of which
  1811.  * the ImageStkPtr is the main structure that ties everything together. The
  1812.  * hierarchy is such that the MsClickPtrs and KeyClickPtrs are pointer
  1813.  * chained within an Imagestkptr.
  1814.  */
  1815.  
  1816. #define nilunitproc NULL
  1817. #define nildataproc NULL
  1818.  
  1819. typedef struct imagestack *imagestkptr;
  1820. typedef struct timetickstk far *timetickptr;
  1821. typedef struct keyclickstk far *keyclickptr;
  1822. typedef struct msclickstk far  *msclickptr;
  1823.  
  1824. typedef unsigned (far *callproc)(imagestkptr,msclickptr);
  1825. typedef struct xyx1y1rec { unsigned x,y,x1,y1; } xyx1y1rec;
  1826. typedef unsigned (far *dataproc)(imagestkptr,unsigned,void *);
  1827.  
  1828. typedef struct timetickstk {
  1829.     timetickptr nexttimetick;    /* chain of timer tick events */
  1830.     timerecptr timepiece;    /* timer counter, flag */
  1831.     unsigned long signature;    /* signature for dropping timer ticks */
  1832.     callproc entrycallproc;    /* timer event - when flag is true */
  1833.     imagestkptr fs;        /* related fs/ms for event */
  1834.     msclickptr ms;
  1835. } timetickstk;
  1836.  
  1837. typedef struct keyclickstk {
  1838.     keyclickptr nextkeyclick;    /* chain of keyboard click areas */
  1839.     unsigned keycode;        /* scancode for capturing */
  1840.     callproc entrycallproc;    /* event for scancode activation */
  1841.     imagestkptr fs;        /* related fs/ms for event */
  1842.     msclickptr ms;
  1843. } keyclickstk;
  1844.  
  1845. typedef struct msclickstk {
  1846.     msclickptr nextmsclick;      /* mouse click chains */
  1847.     unsigned clicknumber;      /* assignable key for mouse click */
  1848.     xyx1y1rec ms;          /* mouse x,y,x1,y1 region */
  1849.     unsigned char msactive;      /* sets inactive mode of mouse */
  1850.     callproc entrycallproc;      /* normal mouse click call event */
  1851.     unsigned char senseactivate;  /* true-sense,false-mouse click */
  1852.     unsigned char sensehighlight; /* enables supervisor to auto   */
  1853.                   /* highlight a mouse click area */
  1854.  
  1855.     unsigned mousebuttons;      /* Defines the active mouse button */
  1856.                   /* 2-right mouse button */
  1857.  
  1858.     callproc doublecallproc;      /* double click event */
  1859.  
  1860.     maskptr mousemask;          /* autochanging of mouse mask */
  1861.     unsigned xhotspot;          /* mouse hot spot of mouse mask */
  1862.     unsigned yhotspot;
  1863.     imagepartial ipptr;       /* Mouse click image partials */
  1864.                   /* used in sliders and pop-off buttons */
  1865. } msclickstk;
  1866.  
  1867. typedef struct framechange *framechangeptr;
  1868. typedef struct framechange {
  1869.     callproc frameenter;    /* Frame Enter Event */
  1870.     callproc frameexit;     /* Frame Exit Event */
  1871.     maskptr entermask;        /* Enter frame Mouse Mask */
  1872.     unsigned xehs, yehs;    /* Enter frame Mouse Hotspots */
  1873.     maskptr exitmask;        /* Exit  frame Mouse Mask */
  1874.     unsigned xxhs, yxhs;    /* Exit frame Mouse Hotspots */
  1875. } framechange;
  1876.  
  1877. typedef struct userrecord *userrecptr;
  1878. typedef struct userrecord {
  1879.     userrecptr nxtuserptr;    /* user data area chains */
  1880.     unsigned userkey;        /* user assigned key for retrieving data */
  1881.     void far *userdataarea;    /* pointer to userdata */
  1882.     dataproc userterminate;    /* terminating call event */
  1883. } userrecord;
  1884.  
  1885. typedef struct pendrecord *pendingptr;
  1886. typedef struct pendrecord {
  1887.     pendingptr nxtpendptr;    /* pending event chains */
  1888.     callproc pendcallproc;    /* pending call proc */
  1889.     imagestkptr pendingfs;    /* pending matching FS */
  1890.     unsigned char pendingclose; /* ignore close pending if false */
  1891. } pendrecord;
  1892.  
  1893. typedef struct moverecord *moveptr;
  1894. typedef struct moverecord {
  1895.     moveptr nxtmove;
  1896.     callproc movecallproc;    /* a user definable event when frame is
  1897.                  * {moved */
  1898. } moverecord;
  1899.  
  1900. typedef struct imagestack {
  1901.     imagestkptr nxtptr;     /* forward chain of Frames */
  1902.     imagestkptr lstptr;     /* backward chain for frame stack */
  1903.     unsigned long signature;    /* time code signature */
  1904.     unsigned frameactive;    /* set by resetframeactive for locking */
  1905.                 /* events from occuring */
  1906.     unsigned x, y, x1, y1;    /* frame coordinates */
  1907.     unsigned char movable;    /* flag indicating mobility of frame */
  1908.     moveptr movecallproc;    /* move event chain */
  1909.     char *iconframe;        /* icon for putpict when moving frame */
  1910.     unsigned iconcolor;     /* icon color */
  1911.     unsigned char emptyframe;    /* flag indicating empty frame */
  1912.     unsigned char autorotate;    /* indicator if frame can be rotated up */
  1913.     xyx1y1rec restrictmovef;    /* move area restriction */
  1914.     xyx1y1rec minmaxstretch;    /* minimum/maximum resize */
  1915.     callproc resizecallproc;    /* required event for re-drawing frame */
  1916.                 /* after frame has been re-sized */
  1917.     unsigned char imageactive;    /* frame hiding/showing flag */
  1918.     imagestkptr relatedstack;    /* related fs for use in Menus and explodes */
  1919.     msclickptr relatedmsclick;    /* related ms for use in Menus and explodes */
  1920.     unsigned long relatedsignate; /* related signature for validating Menus */
  1921.     imagestkptr chainedstack;    /* chained fs sub menu */
  1922.     msclickptr chainedmsclick;    /* chained ms sub menu */
  1923.     imagepartial ipptr;     /* image partial chain */
  1924.     imagepartial iptop;     /* image partial top of chain */
  1925.     keyclickptr keyptr;     /* key chain for local keyclicks */
  1926.     msclickptr msptr;        /* ms chain for mouse click areas */
  1927.     unsigned msclickcount;    /* ms clicks counts */
  1928.     framechangeptr fschangeptr; /* frame enter/exit events */
  1929.     userrecptr userdataptr;    /* user data chain */
  1930. } imagestack;
  1931.  
  1932.  
  1933. extern    imagestkptr   stackptr;
  1934. extern    keyclickptr   keystackptr;
  1935. extern    timetickptr   timestackptr;
  1936. extern    unsigned      functionkeycode;
  1937. extern    unsigned char autorotateup;
  1938. extern    callproc      ctrlbreakproc;
  1939. extern    unsigned long maxwindowsize;
  1940.  
  1941. #ifdef __cplusplus
  1942. extern "C" {
  1943. #endif
  1944.  
  1945. /*
  1946.  * *------------------------------------------------------------------------*
  1947.  * |  Image Stack routines                            |
  1948.  * *------------------------------------------------------------------------*
  1949.  */
  1950.  
  1951. unsigned char _TGdecl frameexist(imagestkptr fs);
  1952. unsigned      _TGdecl countframes(void);
  1953. void          _TGdecl pushimage(unsigned x,unsigned y,unsigned x1,unsigned y1);
  1954. void          _TGdecl pushemptyimage(unsigned x,unsigned y,unsigned x1,unsigned y1);
  1955. void          _TGdecl popimage(void);
  1956. void          _TGdecl prepareforpartialupdate(imagestkptr fs,unsigned x,
  1957.              unsigned y,unsigned x1,unsigned y1);
  1958. void          _TGdecl prepareforupdate(imagestkptr fs);
  1959. void          _TGdecl commitupdate(void);
  1960. void          _TGdecl setframeautorotate(imagestkptr fs,unsigned char autorotate);
  1961. void          _TGdecl rotatestackimage(imagestkptr fs1,imagestkptr fs2);
  1962. void          _TGdecl rotateunderstackimage(imagestkptr fs1,imagestkptr fs2);
  1963. void          _TGdecl moveframe(int *fx,int *fy,int *fx1,int *fy1,
  1964.              int rx,int ry,int rx1,int ry1,int color);
  1965. imagestkptr   _TGdecl frameselectandmove(unsigned mxpos,unsigned mypos);
  1966. unsigned      _TGdecl selectandmoveframe(imagestkptr fs,msclickptr mouseclickpos);
  1967. void          _TGdecl setmoverestrictions(imagestkptr fs,unsigned x,unsigned y,
  1968.              unsigned x1,unsigned y1);
  1969. void          _TGdecl setframemobility(imagestkptr fs,unsigned char movable);
  1970. void          _TGdecl dropmoveframecallproc(imagestkptr fs,callproc entrycallproc);
  1971. void          _TGdecl setmoveframecallproc(imagestkptr fs,callproc entrycallproc);
  1972. void          _TGdecl linkfs(imagestkptr nfs,imagestkptr cfs);
  1973. void          _TGdecl linkunderfs(imagestkptr nfs,imagestkptr cfs);
  1974. void          _TGdecl unlinkfs(imagestkptr fs);
  1975. void          _TGdecl hideimage(imagestkptr fs);
  1976. void          _TGdecl showimage(imagestkptr fs,unsigned x,unsigned y);
  1977. void          _TGdecl movestackimage(imagestkptr fs,unsigned x,unsigned y);
  1978. void          _TGdecl dropstackimage(imagestkptr fs);
  1979. void          _TGdecl createimagebuffer(imagestkptr *fs,unsigned x,unsigned y,
  1980.              unsigned x1,unsigned y1);
  1981. void          _TGdecl dropimagebuffer(imagestkptr fs);
  1982. void          _TGdecl freeimagebuffer(imagestkptr fs);
  1983. imagestkptr   _TGdecl getfrontimage(imagestkptr fs);
  1984. imagestkptr   _TGdecl getpartialfrontimage(imagestkptr fs,unsigned x,unsigned y,
  1985.              unsigned x1,unsigned y1);
  1986. imagestkptr   _TGdecl getpartialbackimage(imagestkptr fs,unsigned x,unsigned y,
  1987.              unsigned x1,unsigned y1);
  1988. imagestkptr   _TGdecl getbackimage(imagestkptr fs);
  1989. void          _TGdecl getfsimage(unsigned x,unsigned y,imagestkptr fs);
  1990. void          _TGdecl putfsimage(unsigned x,unsigned y,imagestkptr fs,unsigned rmwbits);
  1991. imagepartial  _TGdecl sliceimagepartials(imagepartial lastip,unsigned x,unsigned y,
  1992.              unsigned x1,unsigned y1);
  1993. void          _TGdecl resizeframe(imagestkptr fs,unsigned x,unsigned y,unsigned x1,unsigned y1);
  1994. void          _TGdecl setimageactive(imagestkptr fs,unsigned char imageactive);
  1995. void          _TGdecl setframeentercallproc(imagestkptr fs,callproc entrycallproc);
  1996. void          _TGdecl setframeexitcallproc(imagestkptr fs,callproc entrycallproc);
  1997. unsigned char _TGdecl changeuserdatakey(imagestkptr fs,unsigned userkey,unsigned newkey);
  1998. void          _TGdecl getuserdataarea(imagestkptr fs,unsigned userkey,void *userdata);
  1999. void          _TGdecl setuserdataarea(imagestkptr fs,unsigned userkey,void *userdata,
  2000.              dataproc terminatedataproc);
  2001. void          _TGdecl dropuserdataareas(imagestkptr fs,dataproc terminatedataproc);
  2002. void          _TGdecl dropuserdatabykey(imagestkptr fs,unsigned userkey);
  2003. void          _TGdecl dropuserdataarea(imagestkptr fs,userrecptr ud);
  2004. userrecptr    _TGdecl getfirstuserdataarea(imagestkptr fs,dataproc terminatedataproc,void *userdata);
  2005. userrecptr    _TGdecl getnextuserdataarea(userrecptr ud,void *userdata);
  2006. void          _TGdecl setenterexitmousemask(imagestkptr fs,maskptr entermask,unsigned xehs,
  2007.             unsigned yehs,maskptr exitmask,unsigned xxhs,unsigned yxhs);
  2008. void          _TGdecl setstandardmousemask(maskptr mousemask,unsigned xhotspot,unsigned yhotspot);
  2009. void          _TGdecl setfsipcoords(imagestkptr fs,unsigned x,unsigned y);
  2010. unsigned char _TGdecl framesoverlapped(imagestkptr fs1,imagestkptr fs2);
  2011.  
  2012. /*
  2013.  * *------------------------------------------------------------------------*
  2014.  * |  Utility Routines                                |
  2015.  * *------------------------------------------------------------------------*
  2016.  */
  2017.  
  2018. void          _TGdecl clearkeyboardbuf(void);
  2019. void          _TGdecl clearteglkeyboardbuf(void);
  2020. void          _TGdecl setautorotate(unsigned char onoff);
  2021. unsigned char _TGdecl userrelease(void);
  2022. void          _TGdecl waitforuserrelease(void);
  2023.  
  2024. /*
  2025.  * *------------------------------------------------------------------------*
  2026.  * |  Find Mouse Screen positions                        |
  2027.  * *------------------------------------------------------------------------*
  2028.  */
  2029.  
  2030. imagestkptr   _TGdecl findframe(unsigned mxpos,unsigned mypos);
  2031. void          _TGdecl resetframeactive(imagestkptr fs,unsigned char active);
  2032.  
  2033. /*
  2034.  * *------------------------------------------------------------------------*
  2035.  * |  Mouse Click defines                            |
  2036.  * *------------------------------------------------------------------------*
  2037.  */
  2038.  
  2039. msclickptr    _TGdecl findmouseclickptr(imagestkptr fs,unsigned clicknumber);
  2040. unsigned char _TGdecl mouseclickexist(imagestkptr fs,msclickptr ms);
  2041. void          _TGdecl resetmouseclicks(imagestkptr fs,msclickptr clickptr);
  2042. void          _TGdecl resetmsclicksense(imagestkptr fs,unsigned char newsense);
  2043. void          _TGdecl resetmsclickcallproc(imagestkptr fs,unsigned mouseclicknumber,
  2044.              callproc entrycallproc);
  2045. void          _TGdecl resetmsclickactive(imagestkptr fs,unsigned mouseclicknumber,
  2046.              unsigned char active);
  2047. void          _TGdecl definemouseclickarea(imagestkptr fs,unsigned x,
  2048.              unsigned y,unsigned x1,unsigned y1,unsigned char active,
  2049.              callproc entrycallproc,unsigned char sense);
  2050. void          _TGdecl dropmouseclick(imagestkptr fs,msclickptr ms);
  2051. msclickptr    _TGdecl checkmouseclickpos(imagestkptr fs,unsigned mxpos,
  2052.              unsigned mypos);
  2053. void          _TGdecl resetmsassignmentnum(imagestkptr fs,unsigned startcount);
  2054. void          _TGdecl assignmouseclicknumber(imagestkptr fs,msclickptr ms,
  2055.              unsigned clicknumber);
  2056. msclickptr    _TGdecl getlastmsptr(imagestkptr fs);
  2057. void          _TGdecl addmouseclickmask(msclickptr ms,maskptr mousemask,
  2058.              unsigned xhs,unsigned yhs);
  2059. void          _TGdecl definemaskclickarea(imagestkptr fs,unsigned x,unsigned y,
  2060.              unsigned x1,unsigned y1,unsigned char active,
  2061.              callproc entrycallproc,unsigned char sense,
  2062.              maskptr mousemask,unsigned xhs,unsigned yhs);
  2063. void          _TGdecl adddoubleclickcallproc(msclickptr ms,callproc doublecallproc);
  2064. void          _TGdecl definedoubleclickarea(imagestkptr fs,unsigned x,
  2065.             unsigned y,unsigned x1,unsigned y1,unsigned char active,
  2066.             callproc entrycallproc,callproc doublecallproc,
  2067.             unsigned char sense);
  2068. void          _TGdecl setmssensehighlight(msclickptr ms,unsigned char autohighlight);
  2069. void          _TGdecl setmousebutton(msclickptr ms,unsigned mousebutton);
  2070. void          _TGdecl defineiconframe(unsigned x,unsigned y,char *iconimage,
  2071.             unsigned iconcolor,unsigned char active,
  2072.             callproc entrycallproc,unsigned char sense);
  2073. /*
  2074.  * *------------------------------------------------------------------------*
  2075.  * |  Key Click defines                             |
  2076.  * *------------------------------------------------------------------------*
  2077.  */
  2078.  
  2079. void          _TGdecl defineglobalkeyclickarea(imagestkptr fs,msclickptr ms,
  2080.              unsigned keycode,unsigned char repeatkey,callproc entrycallproc);
  2081. void          _TGdecl definelocalkeyclickarea(imagestkptr fs,msclickptr ms,
  2082.              unsigned keycode,unsigned char repeatkey,callproc entrycallproc);
  2083. keyclickptr   _TGdecl findkeyclickptr(imagestkptr fs,unsigned keycode);
  2084. void          _TGdecl dropkeyclick(imagestkptr fs,unsigned keycode,callproc entrycallproc);
  2085. void          _TGdecl resetkeyclickcallproc(imagestkptr fs,unsigned keycode,
  2086.              callproc entrycallproc);
  2087. void          _TGdecl resetlocalkeyclicks(imagestkptr fs);
  2088.  
  2089. /*
  2090.  * *------------------------------------------------------------------------*
  2091.  * |  Supervisor Loop                                |
  2092.  * *------------------------------------------------------------------------*
  2093.  */
  2094.  
  2095. void          _TGdecl toggleoptionbar(imagestkptr fs,msclickptr opt,msclickptr lastopt);
  2096. unsigned      _TGdecl eventmanager(imagestkptr fs,msclickptr ms);
  2097. void          _TGdecl setpendingevent(imagestkptr fs,callproc pendcallproc);
  2098. void          _TGdecl resetpendingcallproc(imagestkptr fs,callproc pendcallproc);
  2099. void          _TGdecl setpendingclose(imagestkptr fs,unsigned char pendingclose);
  2100. unsigned      _TGdecl getfsms(imagestkptr * fs,msclickptr * ms);
  2101.  
  2102. /*
  2103.  * *------------------------------------------------------------------------*
  2104.  * |  Chain functions                                |
  2105.  * *------------------------------------------------------------------------*
  2106.  */
  2107.  
  2108. void          _TGdecl checkctrlbreak(void);
  2109. void          _TGdecl setctrlbreakfs(callproc cbrkproc);
  2110. void          _TGdecl settimertick(unsigned timerinterrupt,
  2111.              callproc entrycallproc,imagestkptr fs,msclickptr ms);
  2112. void          _TGdecl droptimertick(unsigned timerinterrupt,callproc entrycallproc);
  2113.  
  2114. #ifdef __cplusplus
  2115. }
  2116. #endif
  2117. #endif
  2118. /*    teglgrph.h
  2119.  
  2120.     Combined modules of TEGLEASY, TEGLGRPH and TEGLINIT.
  2121.     Central generalize TEGL Startup routines.
  2122.  
  2123.     Copyright (c) TEGL Systems Corporation 1989,1990
  2124.     All Rights Reserved.
  2125. */
  2126.  
  2127. #ifndef __TEGLGRPH_H
  2128. #define __TEGLGRPH_H
  2129.  
  2130. #ifdef __STDTEGL__
  2131. #define _TGdecl
  2132. #else
  2133. #define _TGdecl  cdecl
  2134. #endif
  2135.  
  2136. #ifndef __PASTEGL__
  2137. #define _TGType _TGdecl
  2138. #else
  2139. #define _TGType pascal
  2140. #endif
  2141.  
  2142. #ifndef __TEGLUNIT_H
  2143. #include <teglunit.h>
  2144. #endif
  2145.  
  2146. typedef struct teglconstants {
  2147.        unsigned        teglbackcolor;
  2148.        unsigned        teglbordercolor;
  2149.        unsigned char    teglbackpattern[8];
  2150.        unsigned char    teglbordershow;
  2151.        unsigned char    tegluserpattern;
  2152.        unsigned        teglfillstyle;
  2153.        unsigned        shadowcolor;
  2154.        unsigned        shadowbordercolor;
  2155.        unsigned char    shadowfillpattern[8];
  2156.        unsigned char    shadowuserpattern;
  2157.        unsigned        shadowfillstyle;
  2158.        fontptr        shadowtexttype;
  2159.        unsigned char    defaulttexthighlight;
  2160.        unsigned        defaulttexthcolor;
  2161.        unsigned        defaulttextscolor;
  2162.        unsigned char    shadowtextmode;
  2163.        unsigned        extendtexthcolor;
  2164.        unsigned        extendtextscolor;
  2165.        unsigned        extendtextcolor;
  2166.        unsigned        shifttextcolor;
  2167.        unsigned        shifttextscolor;
  2168.        unsigned        zipduration;
  2169. } teglconstants;
  2170.  
  2171. extern teglconstants tg;
  2172. extern teglconstants herc_tg;
  2173. extern fontptr standardfont;
  2174. extern unsigned char beepstatus;
  2175. extern unsigned beepdivisor;
  2176. extern unsigned char gridfill[];
  2177. extern unsigned char bwtranslatetable[];
  2178. extern unsigned char c256translatetable[];
  2179.  
  2180. #define setshadowfillpattern(bp) memcpy(tg.shadowfillpattern,bp,sizeof(tg.shadowfillpattern)); tg.shadowuserpattern=TRUE
  2181. #define setteglfillpattern(bp) memcpy(tg.teglbackpattern,bp,sizeof(tg.teglbackpattern)); tg.tegluserpattern = TRUE
  2182.  
  2183. #ifdef __cplusplus
  2184. extern "C" {
  2185. #endif
  2186.  
  2187. void           _TGdecl activebutton(unsigned x,unsigned y,char *s,callproc p);
  2188. int           _TGdecl coltox(int col);
  2189. void           _TGdecl errmess(unsigned x,unsigned y,char *s);
  2190. void           _TGdecl fitframe(unsigned *x,unsigned *y,unsigned *width,unsigned *height);
  2191. void           _TGdecl framefromicon(imagestkptr ifs,msclickptr ms,
  2192.               unsigned x,unsigned y,unsigned x1,unsigned y1);
  2193. void           _TGdecl frametext(imagestkptr ifs,int row,int col,char *s);
  2194. unsigned       _TGdecl getmousey(imagestkptr ifs);
  2195. unsigned char  _TGdecl getyesno(unsigned x,unsigned y,char *s);
  2196. void           _TGdecl easytegl(void);
  2197. void           _TGdecl easyout(void);
  2198. unsigned       _TGdecl quit(imagestkptr frame,msclickptr mouseclickpos);
  2199. void           _TGdecl quickframe(imagestkptr *ifs,unsigned *x,unsigned *y,
  2200.               unsigned *width,unsigned *height);
  2201. void           _TGdecl outframetextxy(imagestkptr ifs,unsigned x,unsigned y,char *s);
  2202. void           _TGdecl restoretext(void);
  2203. int           _TGdecl rowtoy(int row);
  2204. int           _TGdecl lastcol(imagestkptr ifs);
  2205. int           _TGdecl lastrow(imagestkptr ifs);
  2206. void           _TGdecl selecteasytext(void);
  2207. void           _TGdecl seteasyfont(fontptr p);
  2208.  
  2209. void           _TGdecl setshadowcolor(unsigned bcolor);
  2210. void           _TGdecl setshadowbordercolor(unsigned bcolor);
  2211. void           _TGdecl setshadowfillstyle(unsigned pattern);
  2212. void           _TGdecl shadowbox(unsigned x,unsigned y,unsigned x1,unsigned y1);
  2213. void           _TGdecl shadowtext(unsigned x,unsigned y,unsigned color,char *textstr);
  2214. void           _TGdecl setshadowtexttype(fontptr texttype);
  2215. void           _TGdecl setshadowtextshadow(unsigned color);
  2216. void           _TGdecl setshadowtexthighlight(unsigned color);
  2217. void           _TGdecl shadowtexthighlightoff(void);
  2218. void           _TGdecl setshadowtextmode(unsigned char modeonoff);
  2219. void           _TGdecl shadowboxtext(unsigned x,unsigned y,unsigned txtlen,char *textstr);
  2220. void           _TGdecl setextendtexthighlight(unsigned color);
  2221. void           _TGdecl setextendtextshadow(unsigned color);
  2222. void           _TGdecl setextendtextcolor(unsigned color);
  2223. void           _TGdecl extendtextxy(unsigned x,unsigned y,char *msg);
  2224. void           _TGdecl shifttextxy(unsigned x,unsigned y,char *msg);
  2225.  
  2226. void           _TGdecl setteglbordershow(unsigned char bordershow);
  2227. void           _TGdecl setteglbackcolor(unsigned backcolor);
  2228. void           _TGdecl setteglbordercolor(unsigned bordercolor);
  2229. void           _TGdecl setteglfillstyle(unsigned pattern);
  2230. void           _TGdecl clearteglscreen(void);
  2231.  
  2232. void           _TGdecl movebox(int ax,int ay,int x,int y,int x1,int y1);
  2233. void           _TGdecl ziptobox(int ax,int ay,int ax1,int ay1,int x,int y,int x1,int y1);
  2234. void           _TGdecl zipfrombox(int ax,int ay,int ax1,int ay1,int x,int y,int x1,int y1);
  2235.  
  2236. void           _TGdecl explodefromiconhide(imagestkptr frame,msclickptr mouseclickpos,
  2237.               unsigned x,unsigned y,unsigned x1,unsigned y1);
  2238. void           _TGdecl explodefrommsclick(imagestkptr frame,msclickptr mouseclickpos,
  2239.               unsigned x,unsigned y,unsigned x1,unsigned y1);
  2240. unsigned       _TGdecl collapsetomsclick(imagestkptr fs,msclickptr mouseclickpos);
  2241. unsigned       _TGdecl collapsetoiconshow(imagestkptr fs,msclickptr mouseclickpos);
  2242.  
  2243. void           _TGdecl pressbutton(imagestkptr fs,msclickptr ms);
  2244. void           _TGdecl releasebutton(imagestkptr fs,msclickptr ms);
  2245. unsigned char  _TGdecl visualbuttonpress(imagestkptr fs,msclickptr ms);
  2246. msclickptr     _TGdecl checkformouseselect(imagestkptr frame);
  2247. void           _TGdecl presssquarebutton(imagestkptr fs,msclickptr ms);
  2248. void           _TGdecl releasesquarebutton(imagestkptr fs,msclickptr ms);
  2249. unsigned char  _TGdecl visualsquarebuttonpress(imagestkptr fs,msclickptr ms);
  2250. void           _TGdecl drawsquarebutton(unsigned x1,unsigned y1,unsigned x2,unsigned y2);
  2251. void           _TGdecl definesquarebuttonclick(imagestkptr fs,unsigned x,unsigned y,
  2252.               unsigned x1,unsigned y1,unsigned rx,unsigned ry,
  2253.               char *button,callproc entrycallproc);
  2254. void           _TGdecl shifttext(unsigned x,unsigned y,unsigned c,unsigned s,char *msg);
  2255. void           _TGdecl definesquarebuttontext(imagestkptr fs,unsigned x,unsigned y,
  2256.               unsigned x1,unsigned y1,unsigned rx,unsigned ry,
  2257.               char *msg,callproc entrycallproc);
  2258. void           _TGdecl bevelbox(unsigned x,unsigned y,unsigned x1,unsigned y1,
  2259.               unsigned topcolor,unsigned botcolor,
  2260.               unsigned interior,unsigned thickness);
  2261. void           _TGdecl bevelboxfs(imagestkptr fs,unsigned x,unsigned y,unsigned x1,
  2262.               unsigned y1,unsigned topcolor,unsigned botcolor,
  2263.               unsigned interior,unsigned thickness);
  2264. void           _TGdecl drawlongbutton(unsigned x,unsigned y,unsigned ln);
  2265. void           _TGdecl putuserbuttonclick(imagestkptr fs,unsigned x,unsigned y,char *msg);
  2266. void           _TGdecl definebuttonclick(imagestkptr fs,unsigned x,unsigned y,
  2267.               char *button,callproc entrycallproc);
  2268. void           _TGdecl definelongbuttonclick(imagestkptr fs,unsigned x,unsigned y,
  2269.               unsigned ln,char *msg,callproc entrycallproc);
  2270. void           _TGdecl defineuserbuttonclick(imagestkptr fs,unsigned x,unsigned y,
  2271.               char *msg,callproc entrycallproc);
  2272. void           _TGdecl beep(int tone,int n,int duration);
  2273. void           _TGdecl slidebeep(int tone1,int tone2,int n);
  2274. void           _TGdecl soundswitch(unsigned char onoff);
  2275. void           _TGdecl flipapage(void);
  2276. void           _TGdecl flipvpage(void);
  2277. void           _TGdecl setapage(unsigned pagenum);
  2278. void           _TGdecl setvpage(unsigned pagenum);
  2279. unsigned char  _TGdecl videopage(void);
  2280. void           _TGdecl outtegltextxy(int x,int y,char *mystr);
  2281. void           _TGdecl fmttegltextxy(int x, int y, char *format,...);
  2282. unsigned char  _TGdecl crclickpress(void);
  2283. unsigned char  _TGdecl crclickrelease(void);
  2284. void           _TGdecl teglinit(char *videomodename,unsigned long hugeminimum);
  2285. void           _TGdecl teglsupervisor(void);
  2286.  
  2287.  
  2288.  
  2289. #ifdef __cplusplus
  2290. }
  2291. #endif
  2292. #endif
  2293.  
  2294. /*    tegledit.h
  2295.  
  2296.     Defines structs and functions for TEGL Edit routines
  2297.  
  2298.     Copyright (c) TEGL Systems Corporation 1989,1990,1991
  2299.     All Rights Reserved.
  2300. */
  2301.  
  2302. #ifndef __TEGLEDIT_H
  2303. #define __TEGLEDIT_H
  2304.  
  2305. #ifdef __STDTEGL__
  2306. #define _TGdecl
  2307. #else
  2308. #define _TGdecl  cdecl
  2309. #endif
  2310.  
  2311. #ifndef __PASTEGL__
  2312. #define _TGType _TGdecl
  2313. #else
  2314. #define _TGType pascal
  2315. #endif
  2316.  
  2317. typedef unsigned char (far *acceptch)(char);
  2318. typedef unsigned char (far *formatstr)(char *);
  2319.  
  2320. typedef struct serec *septr;
  2321. typedef struct serec {
  2322.     unsigned      cpos;
  2323.     char         *txtstr;
  2324.     unsigned      maxlen;
  2325.     unsigned      tcursx;
  2326.     unsigned      tcursy;
  2327.     fontptr       font;
  2328.     unsigned char prop;
  2329.     unsigned      color;
  2330.     msclickptr    ms;
  2331.     acceptch      userch;
  2332.     formatstr     formenter;
  2333.     formatstr     formexit;
  2334.     callproc      formevent;
  2335. } serec;
  2336.  
  2337. #ifdef __cplusplus
  2338. extern "C" {
  2339. #endif
  2340.  
  2341. unsigned char _TGdecl allchars(char ch);
  2342. unsigned char _TGdecl alphaonly(char ch);
  2343. unsigned char _TGdecl numbersonly(char ch);
  2344. unsigned char _TGdecl alphanumeric(char ch);
  2345. unsigned char _TGdecl strnoformat(char *txtstr);
  2346. unsigned char _TGdecl strredisplay(char *txtstr);
  2347.  
  2348. void          _TGdecl strdelete(char *txtstr,unsigned cpos,unsigned nchars);
  2349. void          _TGdecl strinsert(char ch,char * txtstr,unsigned cpos);
  2350.  
  2351. void          _TGdecl definestreditevent(imagestkptr fs,unsigned x,unsigned y,unsigned x1,unsigned y1,
  2352.              unsigned maxlen,unsigned color,fontptr font,unsigned char prop,
  2353.              char *txtstr,acceptch userch,formatstr formenter,
  2354.              formatstr formexit,callproc formevent);
  2355. void          _TGdecl setstredit(imagestkptr fs,msclickptr ms,unsigned ncpos);
  2356. void          _TGdecl dropstreditevents(imagestkptr  fs);
  2357.  
  2358. #ifdef __cplusplus
  2359. }
  2360. #endif
  2361. #endif
  2362. /*    teglspec.h
  2363.  
  2364.     Defines structs and functions for sliders and resizers.
  2365.  
  2366.     Copyright (c) TEGL Systems Corporation 1989,1990
  2367.     All Rights Reserved.
  2368. */
  2369.  
  2370. #ifndef __TEGLSPEC_H
  2371. #define __TEGLSPEC_H
  2372.  
  2373. #ifdef __STDTEGL__
  2374. #define _TGdecl
  2375. #else
  2376. #define _TGdecl  cdecl
  2377. #endif
  2378.  
  2379. #ifndef __PASTEGL__
  2380. #define _TGType _TGdecl
  2381. #else
  2382. #define _TGType pascal
  2383. #endif
  2384.  
  2385. #ifndef __TEGLUNIT_H
  2386. #include <TEGLUNIT.H>
  2387. #endif
  2388.  
  2389. typedef struct sliderms *slidermsptr;
  2390. typedef struct sliderms {
  2391.     slidermsptr  nxtms;
  2392.     msclickptr   ms;    /* related slider area */
  2393. } sliderms;
  2394.  
  2395. typedef struct sliderrec *sliderptr;
  2396. typedef struct sliderrec {
  2397.     imagestkptr  fs;
  2398.     msclickptr   ms1;      /* slider area */
  2399.     msclickptr   ms2;      /* slider button/thumb */
  2400.     slidermsptr  relatedms;   /* related ms for searching */
  2401.     unsigned     minx, maxx;
  2402.     unsigned     miny, maxy;
  2403.     callproc     slidecallproc;
  2404.     callproc     pagea1callproc;
  2405.     callproc     pagea2callproc;
  2406. } sliderrec;
  2407.  
  2408. #ifdef __cplusplus
  2409. extern "C" {
  2410. #endif
  2411.  
  2412. unsigned  _TGdecl selectandresizeframe(imagestkptr fs,msclickptr mouseclickpos);
  2413. void      _TGdecl defineresizeminmax(imagestkptr fs,unsigned minx,unsigned miny,
  2414.              unsigned maxx,unsigned maxy);
  2415. void      _TGdecl defineresizeclickarea(imagestkptr fs,unsigned x,unsigned y,
  2416.              unsigned x1,unsigned y1,callproc resizecallproc);
  2417. void      _TGdecl movesliderbar(sliderptr slptr,unsigned x,unsigned y);
  2418. void      _TGdecl setsliderrelative(sliderptr slptr,unsigned long xrange,
  2419.              unsigned long xpos,unsigned long yrange,unsigned long ypos);
  2420. void      _TGdecl getsliderrelative(sliderptr slptr,unsigned long xrange,
  2421.              unsigned long * xpos,unsigned long yrange,unsigned long * ypos);
  2422. void      _TGdecl dropsliders(imagestkptr frame);
  2423. unsigned  _TGdecl slideraction(imagestkptr fs,msclickptr mouseclickpos);
  2424. void      _TGdecl addsliderpageevent(imagestkptr fs,msclickptr ms,
  2425.              callproc spagea1,callproc spagea2);
  2426. void      _TGdecl definesliderarea(imagestkptr fs,unsigned x,unsigned y,
  2427.              unsigned x1,unsigned y1,unsigned minx,unsigned miny,
  2428.              unsigned maxx,unsigned maxy,callproc slidecallproc);
  2429. sliderptr _TGdecl getlastsliderdef(imagestkptr fs);
  2430. void      _TGdecl addrelatedsliderms(imagestkptr fs,msclickptr sliderms,msclickptr ms);
  2431. void      _TGdecl setslideposition(imagestkptr fs,unsigned mxpos,unsigned mypos);
  2432. sliderptr _TGdecl findsliderfs(imagestkptr frame,msclickptr mouseclickpos);
  2433. void      _TGdecl disposeslider(imagestkptr frame,sliderptr dslptr);
  2434.  
  2435. #ifdef __cplusplus
  2436. }
  2437. #endif
  2438. #endif
  2439. /*    teglmenu.h
  2440.  
  2441.     Defines structs and functions for the TEGL Menu system.
  2442.  
  2443.     Copyright (c) TEGL Systems Corporation 1989,1990
  2444.     All Rights Reserved.
  2445. */
  2446.  
  2447. #ifndef __TEGLMENU_H
  2448. #define __TEGLMENU_H
  2449.  
  2450. #ifdef __STDTEGL__
  2451. #define _TGdecl
  2452. #else
  2453. #define _TGdecl  cdecl
  2454. #endif
  2455.  
  2456. #ifndef __PASTEGL__
  2457. #define _TGType _TGdecl
  2458. #else
  2459. #define _TGType pascal
  2460. #endif
  2461.  
  2462. #define menuentryheight     3
  2463. #define maxtextstringsize  40
  2464.  
  2465. #define UPPERRIGHT        0
  2466. #define UPPERLEFT        1
  2467. #define LOWERRIGHT        2
  2468. #define LOWERLEFT        3
  2469. #define RIGHTTOP        4
  2470. #define LEFTTOP         5
  2471. #define RIGHTBOTTOM        6
  2472. #define LEFTBOTTOM        7
  2473. #define NOTOGGLEENTRY        8
  2474. #define NOTOGGLEEXIT       16
  2475.  
  2476. typedef struct omevents *omeventptr;
  2477. typedef struct optionentry *optioneptr;
  2478. typedef struct optionmenu *optionmptr;
  2479.  
  2480. typedef struct omevents {
  2481.     optionmptr optionmn;
  2482.     unsigned char optiontype;
  2483.     callproc entrycallproc;
  2484.     msclickptr ms;
  2485. } omevents;
  2486.  
  2487. typedef struct optionmenu {
  2488.     optionmptr nextom;
  2489.     unsigned numofentries;
  2490.     unsigned maxwidth;
  2491.     unsigned displaynum;
  2492.     unsigned margin;
  2493.     fontptr fonttype;
  2494.     unsigned char proportional;
  2495.     optioneptr firstentry;
  2496.     optioneptr currententry;
  2497.     unsigned currentoenum;
  2498.  
  2499.     imagestkptr fs;
  2500.     msclickptr ms;
  2501.     int x;
  2502.     int y;
  2503.     int x1;
  2504.     int y1;
  2505.     msclickptr slidems;
  2506.     unsigned selectedoenum;
  2507. } optionmenu;
  2508.  
  2509. typedef struct optionentry {
  2510.     optioneptr nextoe;
  2511.     char entryline[maxtextstringsize+1];
  2512.     unsigned char entryactive;
  2513.     int entrycolor;
  2514.     callproc entrycallproc;
  2515.     optionmptr entrysubom;
  2516.  
  2517.     msclickptr entryms;
  2518.     userrecptr entryud;
  2519.     optionmptr om;
  2520.  
  2521.     unsigned char entryboolean;
  2522.     unsigned entryvalue;
  2523.     void *entryglobal;
  2524. } optionentry;
  2525.  
  2526. typedef struct menuconstants {
  2527.     unsigned barmenumargin;
  2528.     unsigned barmenucolor;
  2529.     unsigned bartextcolor;
  2530.     unsigned barbordercolor;
  2531.     unsigned char barbordershow;
  2532.     unsigned omsliderwidth;
  2533.     unsigned omsliderheight;
  2534.     unsigned char ominactivejagged;
  2535.     unsigned omseparatorline;
  2536.     unsigned ommargin;
  2537.     unsigned omtabsize;
  2538.     unsigned ominactivecolor;
  2539.     unsigned omactivecolor;
  2540.     unsigned ombordercolor;
  2541.     unsigned char hidesubmenu;
  2542. } menuconstants;
  2543.  
  2544.  
  2545. #ifdef __cplusplus
  2546. extern "C" {
  2547. #endif
  2548.  
  2549. /*------------------------------------------------------------------------*
  2550.  |  Menu Constants                              |
  2551.  *------------------------------------------------------------------------*/
  2552. extern menuconstants mc;
  2553. extern menuconstants herc_mc;
  2554.  
  2555. /*------------------------------------------------------------------------*
  2556.  |  Bar Menu routines                              |
  2557.  *------------------------------------------------------------------------*/
  2558.  
  2559. void          _TGdecl createbarmenu(unsigned x,unsigned y,unsigned ln);
  2560. void          _TGdecl outbaroption(char *entrystr,optionmptr om);
  2561. void          _TGdecl outbarevent(char *entrystr,callproc entrycallproc);
  2562.  
  2563. /*------------------------------------------------------------------------*
  2564.  |  Option Menu / Option Entry                          |
  2565.  *------------------------------------------------------------------------*/
  2566. optioneptr    _TGdecl getomoe(optionmptr om,unsigned oenum);
  2567. optionmptr    _TGdecl getfsom(imagestkptr  fs);
  2568. void          _TGdecl entrystatus(optionmptr om,unsigned oenum,unsigned char status);
  2569. void          _TGdecl optiontext(optionmptr om,unsigned oenum,char *entrystr);
  2570.  
  2571. /*------------------------------------------------------------------------*
  2572.  |  Option Menu. Basis of Drop down Menus                  |
  2573.  *------------------------------------------------------------------------*/
  2574.  
  2575. optionmptr    _TGdecl createoptionmenu(fontptr fonttype);
  2576. void          _TGdecl setomdisplaynum(optionmptr om,unsigned displaynum);
  2577. void          _TGdecl setommaxwidth(optionmptr om,unsigned maxwidth);
  2578. void          _TGdecl setommargin(optionmptr om,unsigned margins);
  2579. void          _TGdecl defineoptions(optionmptr om,char *entrystr,unsigned char active,callproc entrycallproc);
  2580. void          _TGdecl defineoptionssub(optionmptr om,char *entrystr,unsigned char active,optionmptr om2);
  2581. void          _TGdecl defineoptionsradio(optionmptr om,char *entrystr,unsigned char active,callproc entrycallproc,unsigned radiovalue,unsigned *radiovar);
  2582. void          _TGdecl defineoptionscheck(optionmptr om,char *entrystr,unsigned char active,callproc entrycallproc,unsigned char *chkmark);
  2583. void          _TGdecl setcurrentoepos(optionmptr om,unsigned oenum);
  2584. void          _TGdecl dropoptionentry(optionmptr om,unsigned oenum);
  2585. void          _TGdecl dropoptionmenu(optionmptr om);
  2586.  
  2587. /*------------------------------------------------------------------------*
  2588.  |  Option Menu Events.                           |
  2589.  *------------------------------------------------------------------------*/
  2590.  
  2591. void          _TGdecl defineoptionclickarea(imagestkptr fs,unsigned x,unsigned y,unsigned x1,unsigned y1,optionmptr om,unsigned char sense,unsigned char omtype,unsigned keycode);
  2592. void          _TGdecl dropoptionclickareas(imagestkptr fs);
  2593.  
  2594. /*------------------------------------------------------------------------*
  2595.  |  Menu Color Constants                          |
  2596.  *------------------------------------------------------------------------*/
  2597.  
  2598. void          _TGdecl setoptionmenucolors(unsigned activecolor,unsigned inactivecolor);
  2599. void          _TGdecl setoptionmenubordercolor(unsigned color);
  2600. void          _TGdecl setbartextcolor(unsigned color);
  2601. void          _TGdecl setbarmenumargin(unsigned margin);
  2602. void          _TGdecl setbarmenucolor(unsigned color);
  2603. void          _TGdecl setbarborderoff(void);
  2604. void          _TGdecl setbarbordercolor(unsigned color);
  2605. void          _TGdecl sethidesubmenu(unsigned char on_off);
  2606. void          _TGdecl setmenumargin(unsigned pixsize);
  2607. void          _TGdecl setmenutabsize(unsigned charnum);
  2608. void          _TGdecl setseparatorline(unsigned mask);
  2609. void          _TGdecl setinactivejaggies(unsigned char on_off);
  2610. void          _TGdecl setomslidersize(unsigned width,unsigned height);
  2611. int          _TGdecl menutextwidth(char *mystr);
  2612. void          _TGdecl outmenutextxy(int x,int y,int color,char *mystr,unsigned maxw);
  2613. unsigned char _TGdecl omexists(optionmptr om);
  2614. unsigned      _TGdecl scanquickkey(char *mystr);
  2615. imagestkptr   _TGdecl openoptionmenu(unsigned x,unsigned y,optionmptr om);
  2616.  
  2617. #ifdef __cplusplus
  2618. }
  2619. #endif
  2620. #endif
  2621. /*    teglpick.h
  2622.  
  2623.     Defines structs and functions for TEGL Picklist.
  2624.  
  2625.     Copyright (c) TEGL Systems Corporation 1989,1990
  2626.     All Rights Reserved.
  2627. */
  2628.  
  2629. #ifndef __TEGLPICK_H
  2630. #define __TEGLPICK_H
  2631.  
  2632. #ifdef __STDTEGL__
  2633. #define _TGdecl
  2634. #else
  2635. #define _TGdecl  cdecl
  2636. #endif
  2637.  
  2638. #ifndef __PASTEGL__
  2639. #define _TGType _TGdecl
  2640. #else
  2641. #define _TGType pascal
  2642. #endif
  2643.  
  2644. #ifndef __TEGLMENU_H
  2645. #include <TEGLMENU.H>
  2646. #endif
  2647.  
  2648. #ifdef __cplusplus
  2649. extern "C" {
  2650. #endif
  2651.  
  2652. optionmptr _TGdecl createpicklist(fontptr fonttype);
  2653. void       _TGdecl definepickitem(optionmptr om,char * entrystr,callproc entrycallproc,char * pickitem);
  2654. void       _TGdecl definepicklistarea(imagestkptr fs,unsigned x,unsigned y,unsigned oeselect,unsigned displaynum,optionmptr om);
  2655. void       _TGdecl detachpicklist(optionmptr om);
  2656. void       _TGdecl attachpicklist(optionmptr om,unsigned oeselect);
  2657. void       _TGdecl insertpickitem(optionmptr om,unsigned oenum,char * entrystr,callproc entrycallproc,char * pickitem);
  2658. void       _TGdecl deletepickitem(optionmptr om,unsigned oenum);
  2659. void       _TGdecl clearpicklist(optionmptr om);
  2660. void       _TGdecl setpicklistwidth(optionmptr om,unsigned maxwidth);
  2661. void       _TGdecl setpicklistmargin(optionmptr om,unsigned marginw);
  2662.  
  2663. #ifdef __cplusplus
  2664. }
  2665. #endif
  2666. #endif
  2667. /*    teglfsio.h
  2668.  
  2669.     Defines structs and functions for dealing with Frame Input and Output
  2670.  
  2671.     Copyright (c) TEGL Systems Corporation 1989,1990,1991
  2672.     All Rights Reserved.
  2673. */
  2674.  
  2675. #ifndef __TEGLFSIO_H
  2676. #define __TEGLFSIO_H
  2677.  
  2678. #ifdef __STDTEGL__
  2679. #define _TGdecl
  2680. #else
  2681. #define _TGdecl  cdecl
  2682. #endif
  2683.  
  2684. #ifndef __PASTEGL__
  2685. #define _TGType _TGdecl
  2686. #else
  2687. #define _TGType pascal
  2688. #endif
  2689.  
  2690. typedef struct frameiorec *frameioptr;
  2691. typedef struct frameiorec {
  2692.     frameioptr   nextframeio;
  2693.     imagestkptr  fs;
  2694.     unsigned     x, y;
  2695.     unsigned     minx, maxx;
  2696.     unsigned     miny, maxy;
  2697. } frameiorec;
  2698.  
  2699. #ifdef __cplusplus
  2700. extern "C" {
  2701. #endif
  2702.  
  2703. frameioptr _TGdecl findfsio(imagestkptr  frame);
  2704. void       _TGdecl openfsio(imagestkptr frame,unsigned x,unsigned y,unsigned x1,unsigned y1);
  2705. void       _TGdecl closefsio(imagestkptr frame);
  2706. void       _TGdecl writefs(imagestkptr fs,char *textstr);
  2707. void       _TGdecl getmargins(imagestkptr frame,unsigned *x,unsigned *y,unsigned *x1,unsigned *y1);
  2708. void       _TGdecl setmargins(imagestkptr frame,unsigned x,unsigned y,unsigned x1,unsigned y1);
  2709. void       _TGdecl gotofsxy(imagestkptr frame,unsigned x,unsigned y);
  2710. unsigned   _TGdecl fsiowherey(imagestkptr frame);
  2711. unsigned   _TGdecl fsiowherex(imagestkptr frame);
  2712. void       _TGdecl scrollup(imagestkptr fs);
  2713. void       _TGdecl scrolldown(imagestkptr fs);
  2714.  
  2715. #ifdef __cplusplus
  2716. }
  2717. #endif
  2718.  
  2719. #endif
  2720. /*    animate.h
  2721.  
  2722.     Defines structs and functions for dealing with animation
  2723.  
  2724.     Copyright (c) TEGL Systems Corporation 1989,1990
  2725.     All Rights Reserved.
  2726. */
  2727.  
  2728. #ifndef __ANIMATE_H
  2729. #define __ANIMATE_H
  2730.  
  2731. #ifdef __STDTEGL__
  2732. #define _TGdecl
  2733. #else
  2734. #define _TGdecl  cdecl
  2735. #endif
  2736.  
  2737. #ifndef __PASTEGL__
  2738. #define _TGType _TGdecl
  2739. #else
  2740. #define _TGType pascal
  2741. #endif
  2742.  
  2743.  
  2744. typedef struct coordinates {
  2745.     int x, y;
  2746. }    coordinates;
  2747.  
  2748. typedef struct animateframe *aframeptr;
  2749. typedef struct animateframe {
  2750.     aframeptr    nextframe;        /* next char *, can be circular buffer */
  2751.     char        *imagepic;           /* image for display */
  2752.     unsigned     tonehz;           /* 0 turns off tone */
  2753.     unsigned     tonedelay;
  2754.     coordinates  movement;           /* next increment */
  2755.     unsigned     imgdelay;           /* delay before next image is placed */
  2756.     unsigned     imagesz;           /* size of image */
  2757.     unsigned     height, width;    /* length and width of image */
  2758.     unsigned     color;           /* color for putpict */
  2759. }    animateframe;
  2760.  
  2761. typedef struct sequenceset *sequenceptr;
  2762. typedef struct sequenceset {
  2763.     sequenceptr  nextsequence;
  2764.     unsigned     sequencenum;
  2765.     aframeptr    sequenceframe;
  2766. }    sequenceset;
  2767.  
  2768. typedef struct animateobject {
  2769.     aframeptr    currentframe;     /* char * to current picture frame */
  2770.     aframeptr    firstframe;       /* first image char * */
  2771.     sequenceptr  sequenceframe;
  2772.     unsigned     framenumber;
  2773.     coordinates  cc;
  2774. }    animateobject;
  2775.  
  2776.  
  2777. #ifdef __cplusplus
  2778. extern "C" {
  2779. #endif
  2780.  
  2781. void     _TGdecl init(animateobject *ao);
  2782. void     _TGdecl origin(animateobject *ao,unsigned ox,unsigned oy);
  2783. void     _TGdecl getorigin(animateobject *ao,int *lastox,int *lastoy);
  2784. void     _TGdecl resetframe(animateobject *ao,unsigned startframe);
  2785. unsigned _TGdecl currentframenumber(animateobject *ao);
  2786. unsigned _TGdecl destination(animateobject *ao,int dx,int dy);
  2787. void     _TGdecl addframe(animateobject *ao,char *pp,int mx,int my,unsigned ht,
  2788.             unsigned wd,unsigned dy,unsigned hz,unsigned hzdy,unsigned co);
  2789. void     _TGdecl sequence(animateobject *ao,unsigned seqnum);
  2790. void     _TGdecl resetsequence(animateobject *ao);
  2791. void     _TGdecl animateinit(void);
  2792. void     _TGdecl animate(animateobject *ao,unsigned numframe);
  2793. void     _TGdecl animatecomplete(animateobject *ao);
  2794. void     _TGdecl anim_init(int argc,char **argv);
  2795.  
  2796. #ifdef __cplusplus
  2797. }
  2798. #endif
  2799.  
  2800. #endif
  2801. /*    extendc.h
  2802.  
  2803.     Prototypes for File function extensions
  2804.  
  2805.     Copyright (c) TEGL Systems Corporation 1989,1990
  2806.     All Rights Reserved.
  2807. */
  2808.  
  2809. #ifndef __EXTENDC_H
  2810. #define __EXTENDC_H
  2811.  
  2812. #ifdef __STDTEGL__
  2813. #define _TGdecl
  2814. #else
  2815. #define _TGdecl  cdecl
  2816. #endif
  2817.  
  2818. #ifndef __PASTEGL__
  2819. #define _TGType _TGdecl
  2820. #else
  2821. #define _TGType pascal
  2822. #endif
  2823.  
  2824. #ifdef __cplusplus
  2825. extern "C" {
  2826. #endif
  2827.  
  2828. char  *_TGdecl fexpand (char *ipath);
  2829. void   _TGdecl dos_getpath(unsigned char drive, char far *pathname);
  2830. int    _TGdecl appendwildcards(char *FilePath);
  2831.  
  2832. #ifdef __cplusplus
  2833. }
  2834. #endif
  2835.  
  2836. #endif
  2837. /*    selectfl.h
  2838.  
  2839.     Prototype for File Selection Event
  2840.  
  2841.     Copyright (c) TEGL Systems Corporation 1989,1990
  2842.     All Rights Reserved.
  2843. */
  2844.  
  2845. #ifndef __SELECTFL_H
  2846. #define __SELECTFL_H
  2847.  
  2848. #ifdef __STDTEGL__
  2849. #define _TGdecl
  2850. #else
  2851. #define _TGdecl  cdecl
  2852. #endif
  2853.  
  2854. #ifndef __PASTEGL__
  2855. #define _TGType _TGdecl
  2856. #else
  2857. #define _TGType pascal
  2858. #endif
  2859.  
  2860. #ifdef __cplusplus
  2861. extern "C" {
  2862. #endif
  2863.  
  2864. char _TGdecl selectafile(int x,int y,char *path,char *fileselected);
  2865.  
  2866. void _TGdecl editstring(imagestkptr fs,int x,int y,int maxlen,char *textstr);
  2867.  
  2868. #ifdef __cplusplus
  2869. }
  2870. #endif
  2871.  
  2872. #endif
  2873. /*    soundunt.h
  2874.  
  2875.     Defines functions for dealing with the IBM speaker
  2876.  
  2877.     Copyright (c) TEGL Systems Corporation 1989,1990
  2878.     All Rights Reserved.
  2879. */
  2880.  
  2881. #ifndef __SOUNDUNT_H
  2882. #define __SOUNDUNT_H
  2883.  
  2884. #ifdef __STDTEGL__
  2885. #define _TGdecl
  2886. #else
  2887. #define _TGdecl  cdecl
  2888. #endif
  2889.  
  2890. #ifndef __PASTEGL__
  2891. #define _TGType _TGdecl
  2892. #else
  2893. #define _TGType pascal
  2894. #endif
  2895.  
  2896.  
  2897. #ifdef __cplusplus
  2898. extern "C" {
  2899. #endif
  2900.  
  2901. unsigned _TGdecl asksoundsense(imagestkptr frame, msclickptr mouseclickpos);
  2902.  
  2903. #ifdef __cplusplus
  2904. }
  2905. #endif
  2906.  
  2907. #endif
  2908. /*    sensems.h
  2909.  
  2910.     Prototype for Setting Mouse Sensitivity Event
  2911.  
  2912.     Copyright (c) TEGL Systems Corporation 1989,1990
  2913.     All Rights Reserved.
  2914. */
  2915.  
  2916. #ifndef __SENSEMS_H
  2917. #define __SENSEMS_H
  2918.  
  2919. #ifdef __STDTEGL__
  2920. #define _TGdecl
  2921. #else
  2922. #define _TGdecl  cdecl
  2923. #endif
  2924.  
  2925. #ifndef __PASTEGL__
  2926. #define _TGType _TGdecl
  2927. #else
  2928. #define _TGType pascal
  2929. #endif
  2930.  
  2931. #ifdef __cplusplus
  2932. extern "C" {
  2933. #endif
  2934.  
  2935. void _TGdecl setmousesense(int x, int y);
  2936.  
  2937. #ifdef __cplusplus
  2938. }
  2939. #endif
  2940.  
  2941. #endif
  2942. /*    debugunt.h
  2943.  
  2944.     Prototypes for Information Events
  2945.  
  2946.     Copyright (c) TEGL Systems Corporation 1989,1990
  2947.     All Rights Reserved.
  2948. */
  2949.  
  2950. #ifndef __DEBUGUNT_H
  2951. #define __DEBUGUNT_H
  2952.  
  2953. #ifdef __STDTEGL__
  2954. #define _TGdecl
  2955. #else
  2956. #define _TGdecl  cdecl
  2957. #endif
  2958.  
  2959. #ifndef __PASTEGL__
  2960. #define _TGType _TGdecl
  2961. #else
  2962. #define _TGType pascal
  2963. #endif
  2964.  
  2965. #ifdef __cplusplus
  2966. extern "C" {
  2967. #endif
  2968.  
  2969. unsigned _TGdecl showcoordinates(imagestkptr frame,msclickptr mouseclickpos);
  2970.  
  2971. unsigned _TGdecl showmousexycoords(imagestkptr fs, msclickptr mouseclickpos);
  2972.  
  2973. unsigned _TGdecl showbuttonstatus(imagestkptr frame,msclickptr mouseclickpos);
  2974.  
  2975. #ifdef __cplusplus
  2976. }
  2977. #endif
  2978.  
  2979. #endif
  2980. /*    pcxgraph.h
  2981.  
  2982.     Defines structs and functions for the TEGL PCX Reader
  2983.  
  2984.     Copyright (c) TEGL Systems Corporation 1989,1990
  2985.     All Rights Reserved.
  2986. */
  2987.  
  2988.  
  2989. #ifndef __PCXGRAPH_H
  2990. #define __PCXGRAPH_H
  2991.  
  2992. #ifdef __STDTEGL__
  2993. #define _TGdecl
  2994. #else
  2995. #define _TGdecl  cdecl
  2996. #endif
  2997.  
  2998. #ifndef __PASTEGL__
  2999. #define _TGType _TGdecl
  3000. #else
  3001. #define _TGType pascal
  3002. #endif
  3003.  
  3004.  
  3005. typedef struct pcxheader {
  3006.     unsigned char manufacturer;
  3007.     unsigned char version;
  3008.     unsigned char encoding;
  3009.     unsigned char bitsperpixel;
  3010.     int xmin,ymin;
  3011.     int xmax,ymax;
  3012.     int hdpi,vdpi;
  3013.     unsigned char colormap[48];
  3014.     unsigned char reserved;
  3015.     unsigned char nplanes;
  3016.     int bytesperline;
  3017.     int paletteinfo;
  3018.     unsigned hscreensize;
  3019.     unsigned vscreensize;
  3020.     unsigned char filler[54];
  3021. } pcxheader;
  3022.  
  3023.  
  3024. #ifdef __cplusplus
  3025. extern "C" {
  3026. #endif
  3027.  
  3028. void       _TGdecl setpcxbwmap(unsigned char r,unsigned char g,unsigned char b,unsigned char i);
  3029. void       _TGdecl quickshowpcxfile(char *pcxfilename,unsigned char palettechange,
  3030.               unsigned baseoffset,unsigned maxlines,unsigned maxwidth);
  3031. void       _TGdecl displaypcxfile(void *pcxbuff,unsigned char palettechange,
  3032.               unsigned baseoffset,unsigned maxlines,unsigned maxwidth);
  3033. virtualptr _TGdecl loadpcxfiletovirtual(char *pcxfilename);
  3034. void       _TGdecl displayvirtualpcxfile(virtualptr pcxbuff,unsigned char palettechange,
  3035.               unsigned baseoffset,unsigned maxlines,unsigned maxwidth);
  3036. void       _TGdecl listpcxheaderinfo(pcxheader *pcxhead);
  3037. void       _TGdecl getpcxheader(char *pcxfilename,pcxheader *pcxhead);
  3038.  
  3039. extern       _TGType egapcx4plane(void * pcxbuff,unsigned baseoffset,unsigned maxlines,unsigned maxwidth);
  3040. extern       _TGType egapcx1plane(void * pcxbuff,unsigned baseoffset,unsigned maxlines,unsigned maxwidth);
  3041.  
  3042. #ifdef __cplusplus
  3043. }
  3044. #endif
  3045. #endif
  3046. /*    twcommon.h
  3047.  
  3048.     Common routines used in TEGL Window Modules
  3049.  
  3050.     Copyright (c) TEGL Systems Corporation 1989,1990
  3051.     All Rights Reserved.
  3052. */
  3053.  
  3054. #ifndef __TWCOMMON_H
  3055. #define __TWCOMMON_H
  3056.  
  3057. #ifdef __STDTEGL__
  3058. #define _TGdecl
  3059. #else
  3060. #define _TGdecl  cdecl
  3061. #endif
  3062.  
  3063. #ifndef __PASTEGL__
  3064. #define _TGType _TGdecl
  3065. #else
  3066. #define _TGType pascal
  3067. #endif
  3068.  
  3069.  
  3070. #define twmaxheaderlen 40    /* -- maximum header string length.  */
  3071.  
  3072. extern unsigned        twminx;
  3073. extern unsigned        twminy;
  3074. extern unsigned        twmaxx;
  3075. extern unsigned        twmaxy;
  3076.  
  3077. extern int           twbordercolor;
  3078. extern int           twheadercolor;
  3079. extern int           twframecolor;
  3080. extern int           twframecolor2;
  3081. extern int           twfillcolor;
  3082. extern int           twtextcolor;
  3083. extern int           twtextbackground;
  3084.  
  3085. extern int           twthickness;
  3086. extern char           twmoveable;
  3087. extern char           twresize;
  3088.  
  3089.  
  3090. extern char           twclipping;
  3091.  
  3092.  
  3093. /* -- dialog CONSTANTS */
  3094. #define TDNOTHING      00    /* -- marker to break apart clusters  */
  3095. #define TDLABEL        01
  3096. #define TDBUTTON       02    /* -- button, like OK or  CANCEL  */
  3097. #define TDICONBUTTON   03    /* -- button, custom */
  3098. #define TDRADIOBUTTON  04    /* -- radio buttons  */
  3099. #define TDCHECKBOX     05
  3100. #define TDUSERDEFINED  06
  3101.  
  3102.  
  3103.  
  3104. /* -- Standard frame drawing routine.  */
  3105. typedef void    (far * framedrawfunc) (int x1, int y1, int x2, int y2, int thickness,
  3106.             int border, int uppershade, int lowershade, int fill);
  3107.  
  3108. /* -- Declare the type of float world coordinate system uses if it is  */
  3109. /* -- defined.    */
  3110.  
  3111. /****  TWWORLD    *******/
  3112.  
  3113. #define TWWORLD
  3114.  
  3115. #ifdef TWWORLD
  3116. /* #define WCFLOATLINT */
  3117.  
  3118. #ifdef WCFLOATLINT
  3119. typedef long  wcfloat;
  3120. #else
  3121. typedef float  wcfloat;
  3122. #endif
  3123.  
  3124. #endif
  3125.  
  3126. struct twpoints {
  3127.   int          x1;
  3128.   int          y1;
  3129.   int          x2;
  3130.   int          y2;
  3131. };
  3132.  
  3133.  
  3134. struct graphvars {
  3135.   int          x_;
  3136.   int          y_;
  3137.   unsigned      color;
  3138.   unsigned      bkcolor;
  3139.   struct linesettingstype linesettings;
  3140.  
  3141.   struct textsettingstype textsettings;
  3142.   struct fillsettingstype fillsettings;
  3143.   /* struct fillpatterntype  fillpattern; */
  3144. };
  3145.  
  3146.  
  3147. extern fontptr           twheaderfont;
  3148. extern fontptr           twdialogfont;
  3149.  
  3150. extern unsigned char   buth;
  3151. extern unsigned char   butw;
  3152. extern unsigned char   udslen;
  3153. extern unsigned char   lrslen;
  3154. extern unsigned char   resizeh;
  3155. extern unsigned char   resizew;
  3156.  
  3157.  
  3158. extern void          *twlfbut;
  3159. extern void          *twrtbut;
  3160. extern void          *twupbut;
  3161. extern void          *twdnbut;
  3162. extern void          *twudbut;
  3163. extern void          *twcrbut;
  3164.  
  3165. #ifdef __cplusplus
  3166. extern "C" {
  3167. #endif
  3168.  
  3169. unsigned    _TGdecl twexitoption(imagestkptr ifs,msclickptr ms);
  3170. void        _TGdecl emergencyexit(void);
  3171. void        _TGdecl tweasystart(void);
  3172. void        _TGdecl twfit(unsigned *i,unsigned *i1,unsigned max);
  3173. void        _TGdecl twfitframe(unsigned *x,unsigned *y,unsigned *width,unsigned *height);
  3174. void        _TGdecl twsetglobalbuttonsize(unsigned char width,unsigned char height);
  3175. void        _TGdecl twsetglobalbuttonicons(void *left,void *right,void *up,void *down,
  3176.                void *updown,void *corner);
  3177. void        _TGdecl twsetglobalslidersize(unsigned char updown,unsigned char leftright);
  3178. void        _TGdecl twsetglobalresizearea(unsigned char width,unsigned char height);
  3179. void        _TGdecl twsetglobalminmax(unsigned minx_,unsigned miny_,unsigned maxx_,unsigned maxy_);
  3180. void        _TGdecl filledrectangle(int x,int y,int x1,int y1,int bordercolor,int fill,int color);
  3181. void        _TGdecl drawsliderbackground(int x1,int y1,int x2,int y2);
  3182. void        _TGdecl lineset(int x1,int y1,int x2,int y2,int c1,int c2);
  3183. void        _TGdecl stdbox(int x1,int y1,int x2,int y2,int thickness,int border,
  3184.                int edgefill,int discard,int fill);
  3185. void        _TGdecl bevbox(int x1,int y1,int x2,int y2,int thickness,int border,
  3186.                 int uppershade,int lowershade,int fill);
  3187. void        _TGdecl getgraphsettings(struct graphvars * gs);
  3188. void        _TGdecl setgraphsettings(struct graphvars * gs);
  3189. void        _TGdecl twsetheaderfont(fontptr font);
  3190. void        _TGdecl twsetdialogfont(void *font);
  3191. void        _TGdecl twcommoninit(void);
  3192.  
  3193. #ifdef __cplusplus
  3194. }
  3195. #endif
  3196. #endif
  3197. /*    twkernel.h
  3198.  
  3199.     TYPE definitions for DIALOGUES
  3200.  
  3201.     Copyright (c) TEGL Systems Corporation 1989,1990
  3202.     All Rights Reserved.
  3203.  */
  3204.  
  3205. #ifndef __TWKERNEL_H
  3206. #define __TWKERNEL_H
  3207.  
  3208. #ifdef __STDTEGL__
  3209. #define _TGdecl
  3210. #else
  3211. #define _TGdecl  cdecl
  3212. #endif
  3213.  
  3214. #ifndef __PASTEGL__
  3215. #define _TGType _TGdecl
  3216. #else
  3217. #define _TGType pascal
  3218. #endif
  3219.  
  3220. typedef struct twdialogitem *twdialogptr;
  3221. typedef struct twdialogitem {
  3222.     int x1, y1;         /* -- display relative on window  */
  3223.     int x2, y2;
  3224.     int sx1, sy1;        /* -- xor box selection indicator locations  */
  3225.     int sx2, sy2;
  3226.     unsigned char active;    /* -- set TRUE if active, FALSE if
  3227.                  * non-selectable  */
  3228.     unsigned char len;        /* -- length of input string (max)  */
  3229.     unsigned char places;    /* -- for floating point display  */
  3230.     msclickptr ms;        /* -- store the associate mouse click ptr  */
  3231.     msclickptr ms_edit;     /* -- associated editior mouse clikc ptr  */
  3232.     int tdtype;         /* -- type of dialogue item, def in twcommon  */
  3233.     char *message;        /* -- prompt or message  */
  3234.     int msnum;            /* -- mouse click number association  */
  3235.     int number;         /* -- simply the counter  */
  3236.     int clusnum;        /* -- cluster number, for grouping items
  3237.                  * together  */
  3238.     int clusitem;        /* -- cluster item, item of group  */
  3239.     void *data;         /* -- points to data item, NULLif not
  3240.                  * required     */
  3241.     char *strdata;        /* -- store intermediate string  */
  3242.     twdialogptr prev;        /* -- point to previous dialog item  */
  3243.     twdialogptr next;        /* -- point to next dialog item  */
  3244.     callproc action;        /* -- user event (attaches to button)  */
  3245. } twdialogitem;
  3246.  
  3247.  
  3248. typedef struct menuitem *twmenuptr;
  3249. typedef struct menuitem {
  3250.     void *next;         /* -- points to next, NULLif last  */
  3251.     unsigned char item;     /* -- just a counter  */
  3252.     char prompt[31];        /* -- the menu item name  */
  3253.     optionmptr om;        /* -- what pulls down from it  */
  3254.     int mousenum;        /* -- store associated mouse num  */
  3255.     unsigned char entries;    /* --  */
  3256.     unsigned char entryactive;    /* -- TRUE if active  */
  3257.     callproc entrycall;     /* -- point to event if its not a pull down */
  3258. } menuitem;
  3259.  
  3260. /*
  3261. The WinFrame record is an 'object-like' data structure.  It contains all
  3262. the data items required to program and manipulate a complex window.  All
  3263. the procedure and functions which access this data record start with
  3264. tw<name> and the parameter list is AT LEAST ONE but may be more, and the
  3265. first parameter is always a WinFramePtr.  In this respect the
  3266. WinFramePtr points to what would be called 'self' in an object-oriented
  3267. implementation.
  3268.  
  3269. Note that this only mimics and object implementation.  It is done to
  3270. make the switch to a TRUE object oriented version easier.
  3271. */
  3272.  
  3273. typedef struct winframe *winframeptr;
  3274. typedef struct winframe {
  3275.     imagestkptr ifs;        /* -- void * from image stack  */
  3276.     imagestkptr iconifs;
  3277.     unsigned char firsttime;    /* -- flag for window drawing. DO NOT TOUCH! */
  3278.     unsigned char redrawonmove; /* -- force redraw after a window move     */
  3279.     framedrawfunc style;    /* -- window framestyle  */
  3280.     int thickness;        /* -- window framethickness  */
  3281.     unsigned x1, y1, x2, y2;    /* -- window coordinates  */
  3282.     unsigned mx1, my1, mx2, my2;/* -- store window size before maximize  */
  3283.     unsigned wx1, wy1, wx2, wy2;/* -- window working coordinates  */
  3284.     /* -- these are the absolute coordinates inside  */
  3285.     /* -- the window allowing for header, border,  */
  3286.     /* -- menu and sliders.  */
  3287.     unsigned minx, miny, maxx, maxy;    /* -- min max for resize  */
  3288.     fontptr font;        /* -- font to use for text output  */
  3289.     fontptr displayfont;    /* -- font for header, menus  */
  3290.     unsigned char theight;    /* -- text height in pixels  */
  3291.     unsigned char twidth;    /* -- text width in pixels  */
  3292.     unsigned char rows;     /* -- number of rows in the working window  */
  3293.     unsigned char cols;     /* -- number of cols in the working window  */
  3294.     int curx;            /* -- cursor location (col, row)  */
  3295.     int cury;
  3296.     unsigned char textattr;    /* -- traditional text char attribute  */
  3297.     unsigned char charclear;    /* -- clear character before drawing new one  */
  3298.     int bordercolor;        /* -- color scheme  */
  3299.     int headercolor;
  3300.     int framecolor;
  3301.     int framecolor2;
  3302.     int fillcolor;
  3303.     int textcolor;
  3304.  
  3305.     /* -- Header and buttons stuff  */
  3306.  
  3307.     unsigned char header;    /* -- if header shown  */
  3308.     char headerstr[twmaxheaderlen + 1];
  3309.     unsigned char maximize;    /* -- TRUE if minimize, maximize OK  */
  3310.     unsigned char maximized;    /* -- TRUE if we are maximized     */
  3311.     int thickstore;        /* -- remember thickness when maximized  */
  3312.     unsigned char minimized;    /* -- TRUE if we are now an icon  */
  3313.     void *icon;         /* -- icon to display when window minimized  */
  3314.  
  3315.     /* -- SLIDERS - up down    */
  3316.  
  3317.     unsigned char updownslider; /* -- TRUE if updown slider shown  */
  3318.     int updnslideper;        /* -- set to sliders relative position % */
  3319.     unsigned char upbuttonpress;/* -- set TRUE if up button was pressed  */
  3320.     unsigned char dnbuttonpress;/* -- set TRUE if down button was pressed  */
  3321.     callproc updownevent;    /* -- user event to process up down slider
  3322.                  * action  */
  3323.     sliderptr updownsldptr;    /* -- store slider void *  */
  3324.     int updownrange;        /* -- scale of the slider  */
  3325.     int updownstep;        /* -- button step value  */
  3326.  
  3327.     /* -- Left right  */
  3328.  
  3329.     unsigned char leftrightslider;    /* -- TRUE if leftright slider shown  */
  3330.     int lfrtslideper;        /* --  */
  3331.     unsigned char lfbuttonpress;/* -- TRUE if left button was pressed  */
  3332.     unsigned char rtbuttonpress;/* -- ture if right button was pressed     */
  3333.     callproc leftrightevent;    /* -- user event to process left right slider
  3334.                  * action  */
  3335.     sliderptr leftrightsldptr;    /* -- store slider void *  */
  3336.     int leftrightrange;
  3337.     int leftrightstep;
  3338.  
  3339.  
  3340.     unsigned char resize;    /* -- TRUE if resizeable  */
  3341.     unsigned char moveable;    /* -- TRUE if window is moveable  */
  3342.     unsigned char proportional; /* -- TRUE if text is displayed
  3343.                  * proportionally     */
  3344.     unsigned char wrap;     /* -- TRUE if text is to wrap at border  */
  3345.  
  3346.     /* -- framemenu  */
  3347.     optionmptr om;        /* -- the alt-space bar menu  */
  3348.     /* -- twMenu     */
  3349.  
  3350.     unsigned char menuentries;    /* -- number of main menu bar selections  */
  3351.     unsigned char menuthickness;/* -- depends on number of lines  */
  3352.     twmenuptr menu;        /* -- points to first item, NULLif none  */
  3353.     twmenuptr menulast;     /* -- last item added  */
  3354.     /* --  */
  3355.  
  3356. #ifdef TWWORLD
  3357.     /* -- world coordinate data items follow, procedures in 'twWorld.pas'  */
  3358.     wcfloat wcx1, wcy1, wcx2, wcy2;    /* -- coordinate system range to use  */
  3359.  
  3360.                     /* -- width an hight in defined system    */
  3361.                     /* -- offset to normalize  */
  3362.     wcfloat wcheight, wcwidth, wcxoff, wcyoff, wcxfac, wcyfac;    /* -- factor to multiply */
  3363.                                 /* by (transforms) */
  3364. #endif
  3365.  
  3366.     unsigned char clipping;
  3367.                 /* -- for 'twdialog' - anchor pointer for dialog list  */
  3368.     twdialogptr twdanchor;    /* -- anchor, starting point for list  */
  3369.     twdialogptr twdcurrent;    /* -- current is also the last item  */
  3370.     unsigned twdcount;        /* -- counts the number of dialog entries  */
  3371.     fontptr twdfont;
  3372.  
  3373.                 /* -- procedural void *s follow  */
  3374.     callproc closeevent;    /* -- userdefined Close from mouse click */
  3375.     callproc menucloseevent;    /* -- userdefined close from menu  */
  3376.     callproc redrawevent;    /* -- redraw window event  */
  3377.                 /* -- the about selection from space bar menu  */
  3378.     callproc aboutevent;
  3379. } winframe;
  3380.  
  3381.  
  3382. #ifdef __cplusplus
  3383. extern "C" {
  3384. #endif
  3385.  
  3386. winframeptr _TGdecl findwinframe(imagestkptr ifs);
  3387. unsigned    _TGdecl redrawwinframe(imagestkptr ifs,msclickptr ms);
  3388. void        _TGdecl twsetcloseevent(winframeptr wf,callproc event);
  3389. unsigned    _TGdecl twcloseevent(imagestkptr ifs,msclickptr ms);
  3390. unsigned    _TGdecl twmenucloseevent(imagestkptr ifs,msclickptr ms);
  3391. void        _TGdecl twclear(winframeptr wf);
  3392. void        _TGdecl twclose(winframeptr wf);
  3393. void        _TGdecl twmenuitem(winframeptr wf,char *s,unsigned char active);
  3394. void        _TGdecl twsubmenuitem(winframeptr wf,char *s,unsigned char active,callproc event);
  3395. void        _TGdecl twselect(winframeptr wf);
  3396. void        _TGdecl twfixup(winframeptr wf);
  3397. void        _TGdecl twdefinemouseclickarea(winframeptr wf,unsigned x1_,unsigned y1_,unsigned x2_,unsigned y2_,unsigned char active,callproc action);
  3398. void        _TGdecl twputpict(winframeptr wf,int x,int y,void *image,int color);
  3399. void        _TGdecl twsetbordercolor(winframeptr wf,unsigned char color);
  3400. void        _TGdecl twsetdisplayfont(winframeptr wf,void *font);
  3401. void        _TGdecl twsetfont(winframeptr wf,void *font);
  3402. void        _TGdecl twsetmaximize(winframeptr wf,unsigned char tf);
  3403. void        _TGdecl twsetredraw(winframeptr wf,callproc redraw_);
  3404. void        _TGdecl twsetresize(winframeptr wf,unsigned char tf);
  3405. void        _TGdecl twsetupdownslider(winframeptr wf,unsigned char active);
  3406. void        _TGdecl twsetleftrightslider(winframeptr wf,unsigned char active);
  3407. void        _TGdecl twsetupdownevent(winframeptr wf,callproc event);
  3408. void        _TGdecl twsetleftrightevent(winframeptr wf,callproc event);
  3409. void        _TGdecl twsetupdownrange(winframeptr wf,int range,int step);
  3410. void        _TGdecl twsetleftrightrange(winframeptr wf,int range,int step);
  3411. void        _TGdecl twsetminimizeicon(winframeptr wf,void *icon);
  3412. void        _TGdecl twscrolldown(winframeptr wf,int num);
  3413. void        _TGdecl twscrollup(winframeptr wf,int num);
  3414. void        _TGdecl twsetfillcolor(winframeptr wf,unsigned char color);
  3415. void        _TGdecl twsetcolor(winframeptr wf,unsigned char color);
  3416. void        _TGdecl twsetthickness(winframeptr wf,unsigned char thickness);
  3417. void        _TGdecl twinit(winframeptr * wf,unsigned x_,unsigned y_,unsigned x1_,unsigned y1_);
  3418. void        _TGdecl twsetwinframecolors(winframeptr wf,unsigned char color1,unsigned char color2);
  3419. void        _TGdecl twsetwindowstyle(winframeptr wf,framedrawfunc style);
  3420. void        _TGdecl twsetheader(winframeptr wf,char *s);
  3421. void        _TGdecl twdrawwindowframe(winframeptr wf);
  3422.  
  3423. #ifdef __cplusplus
  3424. }
  3425. #endif
  3426. #endif
  3427.  
  3428. /*    twwindow.h
  3429.  
  3430.     Standard CRT Output.
  3431.  
  3432.     Copyright (c) TEGL Systems Corporation 1989,1990
  3433.     All Rights Reserved.
  3434. */
  3435.  
  3436. #ifndef __TWWINDOW_H
  3437. #define __TWWINDOW_H
  3438.  
  3439. #ifdef __STDTEGL__
  3440. #define _TGdecl
  3441. #else
  3442. #define _TGdecl  cdecl
  3443. #endif
  3444.  
  3445. #ifndef __PASTEGL__
  3446. #define _TGType _TGdecl
  3447. #else
  3448. #define _TGType pascal
  3449. #endif
  3450.  
  3451. #ifdef __cplusplus
  3452. extern "C" {
  3453. #endif
  3454.  
  3455. void         _TGdecl twcrton(void);
  3456. void         _TGdecl twcrtoff(void);
  3457. void         _TGdecl twcrtassign(winframeptr  wf);
  3458. void         _TGdecl twgotoxy(winframeptr wf, int x_, int y_);
  3459. int         _TGdecl twhix(winframeptr wf, int x_);
  3460. int         _TGdecl twhiy(winframeptr wf, int y_);
  3461. int         _TGdecl twlox(winframeptr wf, int x_);
  3462. int         _TGdecl twloy(winframeptr wf, int y_);
  3463. void         _TGdecl twsettextcolor(winframeptr wf, unsigned char color);
  3464. void         _TGdecl twsettextbackground(winframeptr wf,unsigned char color);
  3465. void         _TGdecl twwritechar(winframeptr wf, char c);
  3466. void         _TGdecl twwritestring(winframeptr wf, char * s);
  3467. void         _TGdecl twwritexy(winframeptr wf, int col, int row, char * s);
  3468. void         _TGdecl twprintf(char *control, ...);
  3469.  
  3470. #ifdef __cplusplus
  3471. }
  3472. #endif
  3473. #endif
  3474. /*    twworld.h
  3475.  
  3476.     World Coordinates in TEGL Windows.
  3477.  
  3478.     Copyright (c) TEGL Systems Corporation 1989,1990
  3479.     All Rights Reserved.
  3480. */
  3481.  
  3482. #ifdef TWWORLD
  3483.  
  3484. #ifndef __TWWORLD_H
  3485. #define __TWWORLD_H
  3486.  
  3487. #ifdef __STDTEGL__
  3488. #define _TGdecl
  3489. #else
  3490. #define _TGdecl  cdecl
  3491. #endif
  3492.  
  3493. #ifndef __PASTEGL__
  3494. #define _TGType _TGdecl
  3495. #else
  3496. #define _TGType pascal
  3497. #endif
  3498.  
  3499. #ifdef __cplusplus
  3500. extern "C" {
  3501. #endif
  3502.  
  3503. void     _TGdecl twwworldselect(winframeptr wf_);
  3504. void     _TGdecl twwarc(winframeptr wf,wcfloat x,wcfloat y,wcfloat stangle,wcfloat endangle,wcfloat radius);
  3505. void     _TGdecl twwbar(winframeptr wf,wcfloat x1,wcfloat y1,wcfloat x2,wcfloat y2);
  3506. void     _TGdecl twwbar3d(winframeptr wf,wcfloat x1,wcfloat y1,wcfloat x2,wcfloat y2,wcfloat depth,unsigned char top);
  3507. void     _TGdecl twwcircle(winframeptr wf,wcfloat x,wcfloat y,wcfloat radius);
  3508. void     _TGdecl twwdefineworld(winframeptr wf,wcfloat x1,wcfloat y1,wcfloat x2,wcfloat y2);
  3509. void     _TGdecl twwellipse(winframeptr wf,wcfloat x,wcfloat y,wcfloat stangle,wcfloat endangle,wcfloat xradius,wcfloat yradius);
  3510. void     _TGdecl twwfillellipse(winframeptr wf,wcfloat x,wcfloat y,wcfloat xradius,wcfloat yradius);
  3511. void     _TGdecl twwfloodfill(winframeptr wf,wcfloat x,wcfloat y,unsigned border);
  3512. unsigned _TGdecl twwgetpixel(winframeptr wf,wcfloat x,wcfloat y);
  3513. void     _TGdecl twwline(winframeptr wf,wcfloat x1,wcfloat y1,wcfloat x2,wcfloat y2);
  3514. void     _TGdecl twwlinerel(winframeptr wf,wcfloat dx,wcfloat dy);
  3515. void     _TGdecl twwlineto(winframeptr wf,wcfloat x,wcfloat y);
  3516. void     _TGdecl twwmoverel(winframeptr wf,wcfloat dx,wcfloat dy);
  3517. void     _TGdecl twwmoveto(winframeptr wf,wcfloat x,wcfloat y);
  3518. void     _TGdecl twwouttextxy(winframeptr wf,wcfloat x,wcfloat y,char *textstring);
  3519. void     _TGdecl twwpieslice(winframeptr wf,wcfloat x,wcfloat y,wcfloat stangle,wcfloat endangle,wcfloat radius);
  3520. void     _TGdecl twwputpixel(winframeptr wf,wcfloat x,wcfloat y,unsigned pixel);
  3521. void     _TGdecl twwrectangle(winframeptr wf,wcfloat x1,wcfloat y1,wcfloat x2,wcfloat y2);
  3522. void     _TGdecl twwsector(winframeptr wf,wcfloat x,wcfloat y,wcfloat stangle,wcfloat endangle,wcfloat xradius,wcfloat yradius);
  3523.  
  3524. #ifdef __cplusplus
  3525. }
  3526. #endif
  3527.  
  3528. #endif
  3529.  
  3530. #endif    /* if TWWORLD */
  3531.  
  3532. /*    twdialog.h
  3533.  
  3534.     Dialog Management in TEGL Windows.
  3535.  
  3536.     Copyright (c) TEGL Systems Corporation 1989,1990
  3537.     All Rights Reserved.
  3538. */
  3539.  
  3540. #ifndef __TWDIALOG_H
  3541. #define __TWDIALOG_H
  3542.  
  3543. #ifdef __STDTEGL__
  3544. #define _TGdecl
  3545. #else
  3546. #define _TGdecl  cdecl
  3547. #endif
  3548.  
  3549. #ifndef __PASTEGL__
  3550. #define _TGType _TGdecl
  3551. #else
  3552. #define _TGType pascal
  3553. #endif
  3554.  
  3555.  
  3556. /* control constants for the conversion routine */
  3557. /* for user defined dialogues .  */
  3558.  
  3559. #define twdcondisplay 0
  3560. #define twdconentry   1
  3561. #define twdcondelete  2
  3562. #define twdconreturn  3
  3563.  
  3564. /* -- This is the type definition of the conversion routine that must be */
  3565. /* -- coded for each user defined Dialogue entry. */
  3566. /* -- The node pointer is passed along for advanced error recovery  */
  3567.  
  3568. typedef void (far * twdconvert) (char *s,void *p,int mode,unsigned char width,unsigned char decimals,twdialogptr node);
  3569.  
  3570.  
  3571. #ifdef __cplusplus
  3572. extern "C" {
  3573. #endif
  3574.  
  3575. int     _TGdecl twdregisterusertype(twdconvert convertproc,acceptch charproc);
  3576. unsigned _TGdecl twdclose(imagestkptr ifs,msclickptr ms);
  3577. void     _TGdecl twdinit(winframeptr * wf,unsigned x1_,unsigned y1_,unsigned x2_,unsigned y2_);
  3578. void     _TGdecl twdadddialogitem(winframeptr wf,int tdtype,int x,int y,char *mess,
  3579.             void *dp,unsigned char len,unsigned char places,callproc event);
  3580. void     _TGdecl twdnewcluster(winframeptr wf);
  3581. void     _TGdecl twdaddlabel(winframeptr wf,int x,int y,char *mess);
  3582. void     _TGdecl twdaddbutton(winframeptr wf,int x,int y,char *mess,callproc event);
  3583. void     _TGdecl twdaddcheckbox(winframeptr wf,int x,int y,char *mess,unsigned char *b);
  3584. void     _TGdecl twdaddradiobutton(winframeptr wf,int x,int y,char *mess,int *i);
  3585. void     _TGdecl twdaddiconbutton(winframeptr wf,int x,int y,void *icon,callproc event);
  3586. void     _TGdecl twdaddinputline(winframeptr wf,int x,int y,char *mess,char *utype,unsigned char len);
  3587.  
  3588. #ifdef __cplusplus
  3589. }
  3590. #endif
  3591. #endif
  3592. /*    EXEC.H
  3593.  
  3594.     do_exec with memory swap.
  3595.  
  3596.     EXEC is a public domain product. For your convenience, we have
  3597.     integrated the library functions with TEGL.
  3598.  
  3599.     Copyright (c) TEGL Systems Corporation 1989,1990
  3600.     All Rights Reserved.
  3601. */
  3602.  
  3603. #ifdef __STDTEGL__
  3604. #define _TGdecl
  3605. #else
  3606. #define _TGdecl  cdecl
  3607. #endif
  3608.  
  3609. #ifndef __PASTEGL__
  3610. #define _TGType _TGdecl
  3611. #else
  3612. #define _TGType pascal
  3613. #endif
  3614.  
  3615. #ifndef __EXEC_H
  3616. #define __EXEC_H
  3617.  
  3618.  
  3619. #ifdef __cplusplus
  3620. extern "C" {
  3621. #endif
  3622.  
  3623. int  _TGdecl do_exec(char *xfn, char *pars, int spwn, unsigned needed,char **envp);
  3624.  
  3625. int cdecl do_spawn (unsigned char method,char *swapfn, char *xeqfn,char *cmdtail,
  3626.             unsigned envlen, char *envp);
  3627.  
  3628. #ifdef    __cplusplus
  3629. }
  3630. #endif
  3631. #endif
  3632.